Appease clippy

This commit is contained in:
Rune Tynan 2024-03-30 20:39:53 -07:00
parent 533a2f448d
commit 5ba9e8695e
No known key found for this signature in database
GPG Key ID: 7ECC932F8B2C731E
2 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ struct TestCase {
impl TestCase {
fn new(parts: &'static [&'static str]) -> Self {
assert!(parts.len() >= 1);
assert!(!parts.is_empty());
TestCase {
parts,
test_bbl: true,
@ -71,7 +71,7 @@ impl TestCase {
// Check that outputs match expectations.
p.push(&self.parts[self.parts.len() - 1]);
p.push(self.parts[self.parts.len() - 1]);
let files = mem.files.borrow();

View File

@ -176,7 +176,7 @@ impl<'a> ExpectedFile<'a> {
.unwrap_or_else(|_| panic!("couldn't get path relative to test root {:?}", path))
.to_str()
.unwrap_or_else(|| panic!("couldn't Unicode-ify file name of {:?}", path))
.replace(|c| std::path::is_separator(c), "_");
.replace(std::path::is_separator, "_");
let mut f = File::open(path).unwrap_or_else(|_| panic!("failed to open {:?}", path));
let mut contents = Vec::new();
@ -214,7 +214,7 @@ impl<'a> ExpectedFile<'a> {
.unwrap_or_else(|_| panic!("couldn't get path relative to test root {:?}", pbase))
.to_str()
.unwrap_or_else(|| panic!("couldn't Unicode-ify file name of {:?}", pbase))
.replace(|c| std::path::is_separator(c), "_");
.replace(std::path::is_separator, "_");
let mut dec = GzDecoder::new(File::open(&pbase).unwrap());
let mut contents = Vec::new();