mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
fix code nits
This commit is contained in:
parent
579e0348d7
commit
04abd5ef2f
@ -32,8 +32,7 @@ pub fn run(
|
||||
if bins.is_empty() {
|
||||
if !options.filter.is_specific() {
|
||||
bail!("a bin target must be available for `cargo run`")
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// this will be verified in cargo_compile
|
||||
}
|
||||
}
|
||||
@ -55,10 +54,10 @@ pub fn run(
|
||||
if !options.filter.is_specific() {
|
||||
let names: Vec<&str> = bins.into_iter().map(|bin| bin.0).collect();
|
||||
bail!(
|
||||
"`cargo run` could not determine which binary to run; set `default-run` \
|
||||
in the manifest or use the `--bin` option to specify\navailable binaries: {}",
|
||||
"`cargo run` requires that a project only have one \
|
||||
executable; use the `--bin` option to specify which one \
|
||||
to run\navailable binaries: {}",
|
||||
names.join(", ")
|
||||
|
||||
)
|
||||
} else {
|
||||
bail!(
|
||||
|
@ -1347,8 +1347,9 @@ fn run_default_multiple_required_features() {
|
||||
assert_that(
|
||||
p.cargo("run"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"error: `cargo run` could not determine which binary to run; set `default-run` \
|
||||
in the manifest or use the `--bin` option to specify\navailable binaries: foo1, foo2",
|
||||
"\
|
||||
error: `cargo run` requires that a project only have one executable; \
|
||||
use the `--bin` option to specify which one to run\navailable binaries: foo1, foo2",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -277,8 +277,9 @@ fn too_many_bins() {
|
||||
p.cargo("run"),
|
||||
// Using [..] here because the order is not stable
|
||||
execs().with_status(101).with_stderr(
|
||||
"[ERROR] `cargo run` could not determine which binary to run; set `default-run` \
|
||||
in the manifest or use the `--bin` option to specify\navailable binaries: [..]\n",
|
||||
"[ERROR] `cargo run` requires that a project only \
|
||||
have one executable; use the `--bin` option \
|
||||
to specify which one to run\navailable binaries: [..]\n",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user