Resolve clippy lints in tests

This commit is contained in:
A. Molzer committed 2025-07-14 19:56:06 +02:00
1 parent a3c81e9830
commit d07da5a6cb
2 files changed
+5 -7

No files matched your search

+5 -5
View File
@@ -45,12 +45,12 @@ fn test_image_color_type_unsupported(file: &str, expected_type: ColorType) {
let img_file = File::open(path).expect("Cannot find test image!"); let img_file = File::open(path).expect("Cannot find test image!");
let mut decoder = Decoder::new(img_file).expect("Cannot create decoder"); let mut decoder = Decoder::new(img_file).expect("Cannot create decoder");
assert_eq!(decoder.colortype().unwrap(), expected_type); assert_eq!(decoder.colortype().unwrap(), expected_type);
assert!(match decoder.read_image() { assert!(matches!(
decoder.read_image(),
Err(tiff::TiffError::UnsupportedError( Err(tiff::TiffError::UnsupportedError(
tiff::TiffUnsupportedError::UnsupportedColorType(_), tiff::TiffUnsupportedError::UnsupportedColorType(_),
)) => true, ))
_ => false, ));
});
} }
#[test] #[test]
@@ -172,7 +172,7 @@ fn test_string_tags() {
&s, &s,
"GraphicsMagick 1.2 unreleased Q16 http://www.GraphicsMagick.org/" "GraphicsMagick 1.2 unreleased Q16 http://www.GraphicsMagick.org/"
), ),
_ => assert!(false), other => unreachable!("Expected Ascii tag from file, got {other:?}"),
}; };
} }
} }
-2
View File
@@ -652,8 +652,6 @@ fn test_auxiliary_directory() {
encoder.write_tag(Tag::ExifDirectory, exif.offset).unwrap(); encoder.write_tag(Tag::ExifDirectory, exif.offset).unwrap();
} }
drop(tiff);
data.set_position(0); data.set_position(0);
let mut decoder = Decoder::new(&mut data).unwrap(); let mut decoder = Decoder::new(&mut data).unwrap();