Skip to content

Commit

Permalink
Fix clippy::needless_lifetimes lints (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Dec 7, 2024
1 parent d1c572d commit 7ae5203
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions path/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion path/src/stroker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/edge_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub struct PathEdgeIter<'a> {
needs_close_line: bool,
}

impl<'a> PathEdgeIter<'a> {
impl PathEdgeIter<'_> {
fn close_line(&mut self) -> Option<PathEdge> {
self.needs_close_line = false;

Expand All @@ -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<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pixmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7ae5203

Please sign in to comment.