Skip to content

Commit

Permalink
Clippy fixes (#2338)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia authored Oct 5, 2024
1 parent 236e07c commit 1bf7543
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl<'a> Frames<'a> {
}
}

impl<'a> Iterator for Frames<'a> {
impl Iterator for Frames<'_> {
type Item = ImageResult<Frame>;
fn next(&mut self) -> Option<ImageResult<Frame>> {
self.iterator.next()
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/bmp/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl<'a, W: Write + 'a> BmpEncoder<'a, W> {
}
}

impl<'a, W: Write> ImageEncoder for BmpEncoder<'a, W> {
impl<W: Write> ImageEncoder for BmpEncoder<'_, W> {
#[track_caller]
fn write_image(
mut self,
Expand Down
4 changes: 2 additions & 2 deletions src/codecs/hdr/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::Item> {
Expand Down Expand Up @@ -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<Self::Item> {
loop {
Expand Down
4 changes: 2 additions & 2 deletions src/codecs/pnm/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<V>(self, samples: V) -> io::Result<()>
where
V: Iterator,
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/pnm/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl PnmHeader {
..
} => {
struct TupltypeWriter<'a>(&'a Option<ArbitraryTuplType>);
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()),
Expand Down
2 changes: 1 addition & 1 deletion src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ pub struct Pixels<'a, I: ?Sized + 'a> {
height: u32,
}

impl<'a, I: GenericImageView> Iterator for Pixels<'a, I> {
impl<I: GenericImageView> Iterator for Pixels<'_, I> {
type Item = (u32, u32, I::Pixel);

fn next(&mut self) -> Option<(u32, u32, I::Pixel)> {
Expand Down

0 comments on commit 1bf7543

Please sign in to comment.