Skip to content

Commit 4f01761

Browse files
committed
Thanks clippy
1 parent 07b8063 commit 4f01761

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

tests/tools/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,14 +1173,15 @@ where
11731173
);
11741174

11751175
let gix_test_hash = env::var_os("GIX_TEST_FIXTURE_HASH").and_then(|os_string| os_string.into_string().ok());
1176-
let hash_kind =
1177-
match gix_test_hash {
1178-
Some(gix_test_hash) => gix_hash::Kind::from_str(&gix_test_hash).expect(&format!(
1179-
"GIX_TEST_FIXTURE_HASH was set to {gix_test_hash} which is an invalid value. Valid values are {}. Exiting.",
1180-
gix_hash::Kind::all().iter().map(|kind| kind.to_string()).collect::<Vec<_>>().join(", ")
1181-
)),
1182-
None => gix_hash::Kind::default(),
1183-
};
1176+
let hash_kind = match gix_test_hash {
1177+
Some(gix_test_hash) => gix_hash::Kind::from_str(&gix_test_hash).unwrap_or_else(|_| {
1178+
panic!(
1179+
"GIX_TEST_FIXTURE_HASH was set to {gix_test_hash} which is an invalid value. Valid values are {}. Exiting.",
1180+
gix_hash::Kind::all().iter().map(std::string::ToString::to_string).collect::<Vec<_>>().join(", ")
1181+
)
1182+
}),
1183+
None => gix_hash::Kind::default(),
1184+
};
11841185

11851186
eprintln!("Using hash '{hash_kind}' when determining which fixture to use or recreate");
11861187

0 commit comments

Comments
 (0)