From 6ab637ea520293ce5a0974f7882ff3f74560fb35 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sun, 22 Dec 2024 00:20:37 -0500 Subject: [PATCH] Fix `clippy::needless_lifetimes` lints --- path/src/path.rs | 4 ++-- path/src/stroker.rs | 2 +- src/edge_builder.rs | 4 ++-- src/painter.rs | 2 +- src/pipeline/mod.rs | 4 ++-- src/pixmap.rs | 2 +- src/shaders/mod.rs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/path/src/path.rs b/path/src/path.rs index 3d72835..455068b 100644 --- a/path/src/path.rs +++ b/path/src/path.rs @@ -265,7 +265,7 @@ pub struct PathSegmentsIter<'a> { last_point: Point, } -impl<'a> PathSegmentsIter<'a> { +impl PathSegmentsIter<'_> { /// Sets the auto closing mode. Off by default. /// /// When enabled, emits an additional `PathSegment::Line` from the current position @@ -331,7 +331,7 @@ impl<'a> PathSegmentsIter<'a> { } } -impl<'a> Iterator for PathSegmentsIter<'a> { +impl Iterator for PathSegmentsIter<'_> { type Item = PathSegment; fn next(&mut self) -> Option { diff --git a/path/src/stroker.rs b/path/src/stroker.rs index c865358..a90147f 100644 --- a/path/src/stroker.rs +++ b/path/src/stroker.rs @@ -23,7 +23,7 @@ struct SwappableBuilders<'a> { outer: &'a mut PathBuilder, } -impl<'a> SwappableBuilders<'a> { +impl SwappableBuilders<'_> { fn swap(&mut self) { // Skia swaps pointers to inner and outer builders during joining, // but not builders itself. So a simple `core::mem::swap` will produce invalid results. diff --git a/src/edge_builder.rs b/src/edge_builder.rs index a741520..4cd5d86 100644 --- a/src/edge_builder.rs +++ b/src/edge_builder.rs @@ -269,7 +269,7 @@ pub struct PathEdgeIter<'a> { needs_close_line: bool, } -impl<'a> PathEdgeIter<'a> { +impl PathEdgeIter<'_> { fn close_line(&mut self) -> Option { self.needs_close_line = false; @@ -278,7 +278,7 @@ impl<'a> PathEdgeIter<'a> { } } -impl<'a> Iterator for PathEdgeIter<'a> { +impl Iterator for PathEdgeIter<'_> { type Item = PathEdge; fn next(&mut self) -> Option { diff --git a/src/painter.rs b/src/painter.rs index 404f877..624e00a 100644 --- a/src/painter.rs +++ b/src/painter.rs @@ -86,7 +86,7 @@ impl Default for Paint<'_> { } } -impl<'a> Paint<'a> { +impl Paint<'_> { /// Sets a paint source to a solid color. pub fn set_color(&mut self, color: Color) { self.shader = Shader::SolidColor(color); diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index eaf350f..b67df99 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -143,7 +143,7 @@ pub enum Stage { pub const STAGES_COUNT: usize = Stage::GammaCompressSrgb as usize + 1; -impl<'a> PixmapRef<'a> { +impl PixmapRef<'_> { #[inline(always)] pub(crate) fn gather(&self, index: u32x8) -> [PremultipliedColorU8; highp::STAGE_WIDTH] { let index: [u32; 8] = bytemuck::cast(index); @@ -161,7 +161,7 @@ impl<'a> PixmapRef<'a> { } } -impl<'a> SubPixmapMut<'a> { +impl SubPixmapMut<'_> { #[inline(always)] pub(crate) fn offset(&self, dx: usize, dy: usize) -> usize { self.real_width * dy + dx diff --git a/src/pixmap.rs b/src/pixmap.rs index c583355..7217995 100644 --- a/src/pixmap.rs +++ b/src/pixmap.rs @@ -571,7 +571,7 @@ pub struct SubPixmapMut<'a> { pub real_width: usize, } -impl<'a> SubPixmapMut<'a> { +impl SubPixmapMut<'_> { /// Returns a mutable slice of pixels. pub fn pixels_mut(&mut self) -> &mut [PremultipliedColorU8] { bytemuck::cast_slice_mut(self.data) diff --git a/src/shaders/mod.rs b/src/shaders/mod.rs index 81f5c27..27c452a 100644 --- a/src/shaders/mod.rs +++ b/src/shaders/mod.rs @@ -56,7 +56,7 @@ pub enum Shader<'a> { Pattern(Pattern<'a>), } -impl<'a> Shader<'a> { +impl Shader<'_> { /// Checks if the shader is guaranteed to produce only opaque colors. pub fn is_opaque(&self) -> bool { match self {