fix code nits

This commit is contained in:
Ralf Jung 2018-07-16 19:45:11 +02:00
parent 579e0348d7
commit 04abd5ef2f
3 changed files with 10 additions and 9 deletions

View File

@ -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!(

View File

@ -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",
), ),
); );
} }

View File

@ -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",
), ),
); );
} }