From 72c06c863ce9f7f5c4e7152acf80e24e2f53ef2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Medina?= Date: Thu, 16 Mar 2023 19:59:22 -0700 Subject: [PATCH] clippy --- faux_macros/src/methods/morphed.rs | 18 +++++++++--------- tests/asynchronous.rs | 2 +- tests/generic_methods.rs | 2 +- tests/multi_mock.rs | 2 +- tests/paths.rs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/faux_macros/src/methods/morphed.rs b/faux_macros/src/methods/morphed.rs index c006d3e..aa6ef9c 100644 --- a/faux_macros/src/methods/morphed.rs +++ b/faux_macros/src/methods/morphed.rs @@ -109,7 +109,7 @@ impl<'a> Signature<'a> { .iter() .skip(1) .map(|a| match a { - syn::FnArg::Typed(arg) => WhenArg(&*arg.ty), + syn::FnArg::Typed(arg) => WhenArg(&arg.ty), syn::FnArg::Receiver(_) => { unreachable!("this is a weird bug in faux if you reached this") } @@ -268,7 +268,7 @@ impl<'a> Signature<'a> { let output = match output { syn::Type::Path(output) => output, - output => return Err(unhandled_self_return(&output)), + output => return Err(unhandled_self_return(output)), }; let wrapped = if is_self(output) { @@ -285,7 +285,7 @@ impl<'a> Signature<'a> { let unpathed_output = output.path.segments.last().unwrap(); let generics = match &unpathed_output.arguments { syn::PathArguments::AngleBracketed(args) => args, - g => return Err(unhandled_self_return(&g)), + g => return Err(unhandled_self_return(g)), }; let first_arg = generics .args @@ -293,11 +293,11 @@ impl<'a> Signature<'a> { .expect("faux bug: no generic arguments but expected at least one"); let first_arg = match first_arg { syn::GenericArgument::Type(syn::Type::Path(ty)) => ty, - _ => return Err(unhandled_self_return(&generics)), + _ => return Err(unhandled_self_return(generics)), }; if !is_self(first_arg) { - return Err(unhandled_self_return(&generics)); + return Err(unhandled_self_return(generics)); } let output_ident = &unpathed_output.ident; @@ -328,7 +328,7 @@ impl<'a> Signature<'a> { #ungenerified::try_unwrap(#block).ok().expect("faux: failed to grab value from reference counter because it was not unique.") ))) } } - _ => return Err(unhandled_self_return(&output)), + _ => return Err(unhandled_self_return(output)), } }; @@ -342,9 +342,9 @@ impl<'a> MethodData<'a> { output: Option<&syn::Type>, name: &syn::Ident, ) -> Vec { - let &MethodData { - ref arg_types, - ref receiver, + let MethodData { + arg_types, + receiver, .. } = self; let receiver_tokens = &receiver.tokens; diff --git a/tests/asynchronous.rs b/tests/asynchronous.rs index 5b3812b..45a5b3b 100644 --- a/tests/asynchronous.rs +++ b/tests/asynchronous.rs @@ -1,4 +1,4 @@ -#![allow(clippy::blacklisted_name)] +#![allow(clippy::disallowed_names)] #[faux::create] pub struct Foo {} diff --git a/tests/generic_methods.rs b/tests/generic_methods.rs index 94c7656..160588a 100644 --- a/tests/generic_methods.rs +++ b/tests/generic_methods.rs @@ -1,4 +1,4 @@ -#![allow(clippy::blacklisted_name)] +#![allow(clippy::disallowed_names)] pub trait MyTrait {} diff --git a/tests/multi_mock.rs b/tests/multi_mock.rs index 98f1dbb..96e5c06 100644 --- a/tests/multi_mock.rs +++ b/tests/multi_mock.rs @@ -1,4 +1,4 @@ -#![allow(clippy::blacklisted_name)] +#![allow(clippy::disallowed_names)] #[faux::create] struct Foo { diff --git a/tests/paths.rs b/tests/paths.rs index 1ec4415..4395853 100644 --- a/tests/paths.rs +++ b/tests/paths.rs @@ -1,4 +1,4 @@ -#![allow(clippy::blacklisted_name)] +#![allow(clippy::disallowed_names)] mod bar { #[faux::create]