From e0bb84a31750c41cd40efcb23d4f557ba5889686 Mon Sep 17 00:00:00 2001 From: Jonathan Behrens Date: Sat, 5 Oct 2024 12:30:46 -0700 Subject: [PATCH] Clippy fixes --- src/animation.rs | 2 +- src/codecs/bmp/encoder.rs | 2 +- src/codecs/hdr/encoder.rs | 4 ++-- src/codecs/pnm/encoder.rs | 4 ++-- src/codecs/pnm/header.rs | 2 +- src/image.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/animation.rs b/src/animation.rs index e9b44c8b2d..262ff38d6f 100644 --- a/src/animation.rs +++ b/src/animation.rs @@ -26,7 +26,7 @@ impl<'a> Frames<'a> { } } -impl<'a> Iterator for Frames<'a> { +impl Iterator for Frames<'_> { type Item = ImageResult; fn next(&mut self) -> Option> { self.iterator.next() diff --git a/src/codecs/bmp/encoder.rs b/src/codecs/bmp/encoder.rs index 48977e5690..457e5d9d12 100644 --- a/src/codecs/bmp/encoder.rs +++ b/src/codecs/bmp/encoder.rs @@ -272,7 +272,7 @@ impl<'a, W: Write + 'a> BmpEncoder<'a, W> { } } -impl<'a, W: Write> ImageEncoder for BmpEncoder<'a, W> { +impl ImageEncoder for BmpEncoder<'_, W> { #[track_caller] fn write_image( mut self, diff --git a/src/codecs/hdr/encoder.rs b/src/codecs/hdr/encoder.rs index ea50c91c81..598ad539d9 100644 --- a/src/codecs/hdr/encoder.rs +++ b/src/codecs/hdr/encoder.rs @@ -140,7 +140,7 @@ impl<'a> RunIterator<'a> { } } -impl<'a> Iterator for RunIterator<'a> { +impl Iterator for RunIterator<'_> { type Item = RunOrNot; fn next(&mut self) -> Option { @@ -179,7 +179,7 @@ impl<'a> NorunCombineIterator<'a> { } // Combines sequential noruns produced by RunIterator -impl<'a> Iterator for NorunCombineIterator<'a> { +impl Iterator for NorunCombineIterator<'_> { type Item = RunOrNot; fn next(&mut self) -> Option { loop { diff --git a/src/codecs/pnm/encoder.rs b/src/codecs/pnm/encoder.rs index bb80ad2027..4b6cc18fb0 100644 --- a/src/codecs/pnm/encoder.rs +++ b/src/codecs/pnm/encoder.rs @@ -522,7 +522,7 @@ impl<'a> CheckedHeader<'a> { struct SampleWriter<'a>(&'a mut dyn Write); -impl<'a> SampleWriter<'a> { +impl SampleWriter<'_> { fn write_samples_ascii(self, samples: V) -> io::Result<()> where V: Iterator, @@ -633,7 +633,7 @@ impl<'a> From<&'a [u16]> for FlatSamples<'a> { } } -impl<'a> TupleEncoding<'a> { +impl TupleEncoding<'_> { fn write_image(&self, writer: &mut dyn Write) -> ImageResult<()> { match *self { TupleEncoding::PbmBits { diff --git a/src/codecs/pnm/header.rs b/src/codecs/pnm/header.rs index fa981f351e..40e82dc165 100644 --- a/src/codecs/pnm/header.rs +++ b/src/codecs/pnm/header.rs @@ -304,7 +304,7 @@ impl PnmHeader { .. } => { struct TupltypeWriter<'a>(&'a Option); - impl<'a> fmt::Display for TupltypeWriter<'a> { + impl fmt::Display for TupltypeWriter<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 { Some(tt) => writeln!(f, "TUPLTYPE {}", tt.name()), diff --git a/src/image.rs b/src/image.rs index 06a5953e41..cc2ddfc14a 100644 --- a/src/image.rs +++ b/src/image.rs @@ -799,7 +799,7 @@ pub struct Pixels<'a, I: ?Sized + 'a> { height: u32, } -impl<'a, I: GenericImageView> Iterator for Pixels<'a, I> { +impl Iterator for Pixels<'_, I> { type Item = (u32, u32, I::Pixel); fn next(&mut self) -> Option<(u32, u32, I::Pixel)> {