You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use syn::{spanned::Spanned,Attribute,FnArg,Ident,ItemTrait,Lifetime,Pat,PatIdent,ReturnType,Signature,TraitBound,TraitBoundModifier,TraitItem,TraitItemConst,TraitItemMethod,TraitItemType,Type,TypeParamBound,WherePredicate,PatType,Token};
5
+
use syn::punctuated::Punctuated;
9
6
10
7
usecrate::{
11
8
analyze::find_suitable_param_names,
@@ -577,29 +574,46 @@ fn gen_method_item(
577
574
// If this method has a `#[auto_impl(keep_default_for(...))]` attribute for
578
575
// the given proxy type, we don't generate anything for this impl block.
579
576
ifshould_keep_default_for(item, proxy_type){
580
-
if item.default.is_some(){
581
-
returnOk(TokenStream2::new());
577
+
returnif item.default.is_some(){
578
+
Ok(TokenStream2::new())
582
579
}else{
583
580
emit_error!(
584
581
item.sig.span(),
585
582
"the method `{}` has the attribute `keep_default_for` but is not a default \
586
583
method (no body is provided)",
587
584
item.sig.ident,
588
585
);
589
-
returnErr(());
586
+
Err(())
590
587
}
591
588
}
592
589
593
590
// Determine the kind of the method, determined by the self type.
0 commit comments