From d07da5a6cb937e36806a0053413af6fd24bbc06e Mon Sep 17 00:00:00 2001 From: "A. Molzer" <5550310+197g@users.noreply.github.com> Date: Mon, 14 Jul 2025 18:28:30 +0200 Subject: [PATCH] Resolve clippy lints in tests --- tests/decode_images.rs | 10 +++++----- tests/encode_images.rs | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/decode_images.rs b/tests/decode_images.rs index a459c86..b53fa82 100644 --- a/tests/decode_images.rs +++ b/tests/decode_images.rs @@ -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 mut decoder = Decoder::new(img_file).expect("Cannot create decoder"); assert_eq!(decoder.colortype().unwrap(), expected_type); - assert!(match decoder.read_image() { + assert!(matches!( + decoder.read_image(), Err(tiff::TiffError::UnsupportedError( tiff::TiffUnsupportedError::UnsupportedColorType(_), - )) => true, - _ => false, - }); + )) + )); } #[test] @@ -172,7 +172,7 @@ fn test_string_tags() { &s, "GraphicsMagick 1.2 unreleased Q16 http://www.GraphicsMagick.org/" ), - _ => assert!(false), + other => unreachable!("Expected Ascii tag from file, got {other:?}"), }; } } diff --git a/tests/encode_images.rs b/tests/encode_images.rs index c183543..ea83b25 100644 --- a/tests/encode_images.rs +++ b/tests/encode_images.rs @@ -652,8 +652,6 @@ fn test_auxiliary_directory() { encoder.write_tag(Tag::ExifDirectory, exif.offset).unwrap(); } - drop(tiff); - data.set_position(0); let mut decoder = Decoder::new(&mut data).unwrap();