1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Fix various 'if_then_panic' clippy warnings

This commit is contained in:
Sylvestre Ledru 2021-10-10 09:57:39 +02:00
parent 32ec3f75ee
commit 00de952592
3 changed files with 42 additions and 59 deletions

View file

@ -28,9 +28,7 @@ macro_rules! fixture_path {
macro_rules! assert_fixture_exists {
($fname:expr) => {{
let fpath = fixture_path!($fname);
if !fpath.exists() {
panic!("Fixture missing: {:?}", fpath);
}
assert!(fpath.exists(), "Fixture missing: {:?}", fpath);
}};
}
@ -38,9 +36,7 @@ macro_rules! assert_fixture_exists {
macro_rules! assert_fixture_not_exists {
($fname:expr) => {{
let fpath = PathBuf::from(format!("./fixtures/dd/{}", $fname));
if fpath.exists() {
panic!("Fixture present: {:?}", fpath);
}
assert!(!fpath.exists(), "Fixture present: {:?}", fpath);
}};
}