Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
nrxus committed Mar 17, 2023
1 parent 709e053 commit 72c06c8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions faux_macros/src/methods/morphed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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) {
Expand All @@ -285,19 +285,19 @@ 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
.first()
.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;
Expand Down Expand Up @@ -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)),
}
};

Expand All @@ -342,9 +342,9 @@ impl<'a> MethodData<'a> {
output: Option<&syn::Type>,
name: &syn::Ident,
) -> Vec<syn::ImplItemMethod> {
let &MethodData {
ref arg_types,
ref receiver,
let MethodData {
arg_types,
receiver,
..
} = self;
let receiver_tokens = &receiver.tokens;
Expand Down
2 changes: 1 addition & 1 deletion tests/asynchronous.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

#[faux::create]
pub struct Foo {}
Expand Down
2 changes: 1 addition & 1 deletion tests/generic_methods.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

pub trait MyTrait {}

Expand Down
2 changes: 1 addition & 1 deletion tests/multi_mock.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

#[faux::create]
struct Foo {
Expand Down
2 changes: 1 addition & 1 deletion tests/paths.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

mod bar {
#[faux::create]
Expand Down

0 comments on commit 72c06c8

Please sign in to comment.