Skip to content

Commit

Permalink
Auto merge of #10051 - gilescope:one-waffer-thin-alloc-less, r=Eh2406
Browse files Browse the repository at this point in the history
no need to clone

one less clone,
match => if let
  • Loading branch information
bors committed Nov 7, 2021
2 parents b4ab730 + 142c49d commit fa03f0e
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/cargo/ops/cargo_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ fn run_unit_tests(
script_meta,
} in compilation.tests.iter()
{
let test = unit.target.name().to_string();

let test_path = unit.target.src_path().path().unwrap();
let exe_display = if let TargetKind::Test = unit.target.kind() {
format!(
Expand Down Expand Up @@ -117,20 +115,17 @@ fn run_unit_tests(

let result = cmd.exec();

match result {
Err(e) => {
let e = e.downcast::<ProcessError>()?;
errors.push((
unit.target.kind().clone(),
test.clone(),
unit.pkg.name().to_string(),
e,
));
if !options.no_fail_fast {
break;
}
if let Err(e) = result {
let e = e.downcast::<ProcessError>()?;
errors.push((
unit.target.kind().clone(),
unit.target.name().to_string(),
unit.pkg.name().to_string(),
e,
));
if !options.no_fail_fast {
break;
}
Ok(()) => {}
}
}

Expand Down

0 comments on commit fa03f0e

Please sign in to comment.