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 bins.is_empty() {
|
||||||
if !options.filter.is_specific() {
|
if !options.filter.is_specific() {
|
||||||
bail!("a bin target must be available for `cargo run`")
|
bail!("a bin target must be available for `cargo run`")
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// this will be verified in cargo_compile
|
// this will be verified in cargo_compile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,10 +54,10 @@ pub fn run(
|
|||||||
if !options.filter.is_specific() {
|
if !options.filter.is_specific() {
|
||||||
let names: Vec<&str> = bins.into_iter().map(|bin| bin.0).collect();
|
let names: Vec<&str> = bins.into_iter().map(|bin| bin.0).collect();
|
||||||
bail!(
|
bail!(
|
||||||
"`cargo run` could not determine which binary to run; set `default-run` \
|
"`cargo run` requires that a project only have one \
|
||||||
in the manifest or use the `--bin` option to specify\navailable binaries: {}",
|
executable; use the `--bin` option to specify which one \
|
||||||
|
to run\navailable binaries: {}",
|
||||||
names.join(", ")
|
names.join(", ")
|
||||||
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
bail!(
|
bail!(
|
||||||
|
@ -1347,8 +1347,9 @@ fn run_default_multiple_required_features() {
|
|||||||
assert_that(
|
assert_that(
|
||||||
p.cargo("run"),
|
p.cargo("run"),
|
||||||
execs().with_status(101).with_stderr(
|
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"),
|
p.cargo("run"),
|
||||||
// Using [..] here because the order is not stable
|
// Using [..] here because the order is not stable
|
||||||
execs().with_status(101).with_stderr(
|
execs().with_status(101).with_stderr(
|
||||||
"[ERROR] `cargo run` could not determine which binary to run; set `default-run` \
|
"[ERROR] `cargo run` requires that a project only \
|
||||||
in the manifest or use the `--bin` option to specify\navailable binaries: [..]\n",
|
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