From: Aleksey Kladov Date: Sat, 10 Mar 2018 13:25:42 +0000 (+0300) Subject: Inline `config_from_args` X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~47^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7dcc030e3d9dd34ec510ce7cc8f79ac70c30ca72;p=cargo.git Inline `config_from_args` --- diff --git a/src/bin/cli.rs b/src/bin/cli.rs index 6894d3bb6..0b6242e59 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -73,7 +73,14 @@ pub fn do_main(config: &mut Config) -> CliResult { } fn execute_subcommand(config: &mut Config, args: ArgMatches) -> CliResult { - config_from_args(config, &args)?; + config.configure( + args.occurrences_of("verbose") as u32, + if args.is_present("quite") { Some(true) } else { None }, + &args.value_of("color").map(|s| s.to_string()), + args.is_present("frozen"), + args.is_present("locked"), + &args.values_of_lossy("unstable-features").unwrap_or_default(), + )?; match args.subcommand() { ("bench", Some(args)) => { diff --git a/src/bin/command_prelude.rs b/src/bin/command_prelude.rs index cc48bd373..d8a5fa7eb 100644 --- a/src/bin/command_prelude.rs +++ b/src/bin/command_prelude.rs @@ -176,18 +176,6 @@ pub fn values(args: &ArgMatches, name: &str) -> Vec { } -pub fn config_from_args(config: &mut Config, args: &ArgMatches) -> CargoResult<()> { - let color = args.value_of("color").map(|s| s.to_string()); - config.configure( - args.occurrences_of("verbose") as u32, - if args.is_present("quite") { Some(true) } else { None }, - &color, - args.is_present("frozen"), - args.is_present("locked"), - &args.values_of_lossy("unstable-features").unwrap_or_default(), - ) -} - pub fn root_manifest_from_args(config: &Config, args: &ArgMatches) -> CargoResult { let manifest_path = args.value_of("manifest-path").map(|s| s.to_string()); find_root_manifest_for_wd(manifest_path, config.cwd())