Skip to content

Commit 2cc5bb0

Browse files
committed
Fix failing tests: cargo install may not be called from a workspace, replaced max_values -> number_of_values
1 parent 56b6a80 commit 2cc5bb0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/bin/cargo/commands/install.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
7979

8080
config.reload_rooted_at_cargo_home()?;
8181
let mut compile_opts = args.compile_options(config, CompileMode::Build)?;
82-
83-
let ws = args.workspace(config)?;
84-
85-
args.check_optional_opts_example_and_bin(&ws, &compile_opts)?;
82+
83+
if let Ok(ws) = args.workspace(config) {
84+
args.check_optional_opts_example_and_bin(&ws, &compile_opts)?;
85+
}
8686

8787
compile_opts.build_config.release = !args.is_present("debug");
8888

src/cargo/util/command_prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub fn optional_multi_opt(
206206
.value_name(value_name)
207207
.multiple(true)
208208
.min_values(0)
209-
.max_values(1)
209+
.number_of_values(1)
210210
}
211211

212212
pub fn multi_opt(

0 commit comments

Comments
 (0)