Skip to content

Commit

Permalink
refactor: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Jul 25, 2023
1 parent 204228c commit c98429d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/helpers.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit c98429d

Please sign in to comment.