From f2f062c29abdcaa4eb294c0c773006e8f3b93dfc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 12 Mar 2018 23:20:12 +0300 Subject: [PATCH] Use `avoid_dev_deps` for all commands --- src/bin/cli.rs | 3 --- src/bin/command_prelude.rs | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/cli.rs b/src/bin/cli.rs index b9653661e..1b8b1e4ac 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -110,9 +110,6 @@ fn execute_subcommand(config: &mut Config, args: ArgMatches) -> CliResult { } ("build", Some(args)) => { let mut ws = args.workspace(config)?; - if config.cli_unstable().avoid_dev_deps { - ws.set_require_optional_deps(false); - } let compile_opts = args.compile_options(config, CompileMode::Build)?; ops::compile(&ws, &compile_opts)?; Ok(()) diff --git a/src/bin/command_prelude.rs b/src/bin/command_prelude.rs index 83c6acb47..7f125b151 100644 --- a/src/bin/command_prelude.rs +++ b/src/bin/command_prelude.rs @@ -190,7 +190,11 @@ pub trait ArgMatchesExt { fn workspace<'a>(&self, config: &'a Config) -> CargoResult> { let root = self.root_manifest(config)?; - Workspace::new(&root, config) + let mut ws = Workspace::new(&root, config)?; + if config.cli_unstable().avoid_dev_deps { + ws.set_require_optional_deps(false); + } + Ok(ws) } fn jobs(&self) -> CargoResult> { -- 2.30.2