From c98429dcb765eee2b822543f25351b248089867a Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Tue, 25 Jul 2023 19:59:01 +0200 Subject: [PATCH] refactor: clippy --- src/helpers.rs | 8 ++++---- tests/borrowed.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 42fd4ce..8b72437 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,7 +1,7 @@ use crate::field_kind::FieldKind; pub fn has_lifetime_arguments(segments: &[syn::PathSegment]) -> bool { - if let Some(&syn::PathArguments::AngleBracketed(ref generics)) = + if let Some(syn::PathArguments::AngleBracketed(generics)) = segments.last().map(|x| &x.arguments) { generics @@ -14,7 +14,7 @@ pub fn has_lifetime_arguments(segments: &[syn::PathSegment]) -> bool { } pub fn number_of_type_arguments(segments: &[syn::PathSegment]) -> usize { - if let Some(&syn::PathArguments::AngleBracketed(ref generics)) = + if let Some(syn::PathArguments::AngleBracketed(generics)) = segments.last().map(|x| &x.arguments) { generics @@ -28,7 +28,7 @@ pub fn number_of_type_arguments(segments: &[syn::PathSegment]) -> usize { } pub fn has_binding_arguments(segments: &[syn::PathSegment]) -> bool { - if let Some(&syn::PathArguments::AngleBracketed(ref generics)) = + if let Some(syn::PathArguments::AngleBracketed(generics)) = segments.last().map(|x| &x.arguments) { generics @@ -66,7 +66,7 @@ pub fn is_cow(segments: &[syn::PathSegment]) -> bool { } pub fn is_cow_alike(segments: &[syn::PathSegment]) -> bool { - if let Some(&syn::PathArguments::AngleBracketed(ref _data)) = + if let Some(syn::PathArguments::AngleBracketed(_data)) = segments.last().map(|x| &x.arguments) { has_lifetime_arguments(segments) diff --git a/tests/borrowed.rs b/tests/borrowed.rs index 40e86ed..d81cf2a 100644 --- a/tests/borrowed.rs +++ b/tests/borrowed.rs @@ -37,6 +37,6 @@ fn borrowed() { fn test<'b, 'a: 'b>(lives_longer: &Foo<'a>, lives_less: Foo<'b>) { drop(lives_less); - #[allow(clippy::drop_ref)] + #[allow(dropping_references)] drop(lives_longer); }