Skip to content

Commit

Permalink
refactor(derive): Split up chained calls
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 14, 2022
1 parent ce5cc92 commit ae81b09
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions clap_derive/src/derives/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,13 @@ pub fn gen_augment(
let explicit_methods = attrs.field_methods(true);

Some(quote_spanned! { field.span()=>
let #app_var = #app_var.arg(
clap::Arg::new(#id)
#implicit_methods
#explicit_methods
);
let #app_var = #app_var.arg({
let arg = clap::Arg::new(#id)
#implicit_methods;
let arg = arg
#explicit_methods;
arg
});
})
}
}
Expand Down

0 comments on commit ae81b09

Please sign in to comment.