From 142c49d79d81870a95f3c4b0eddb4f733041fa20 Mon Sep 17 00:00:00 2001 From: gilescope Date: Sat, 6 Nov 2021 21:56:12 +0000 Subject: [PATCH] no need to clone I don't think here. --- src/cargo/ops/cargo_test.rs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/cargo/ops/cargo_test.rs b/src/cargo/ops/cargo_test.rs index f07f67fb53b..04d6b1ac27a 100644 --- a/src/cargo/ops/cargo_test.rs +++ b/src/cargo/ops/cargo_test.rs @@ -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!( @@ -117,20 +115,17 @@ fn run_unit_tests( let result = cmd.exec(); - match result { - Err(e) => { - let e = e.downcast::()?; - 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::()?; + errors.push(( + unit.target.kind().clone(), + unit.target.name().to_string(), + unit.pkg.name().to_string(), + e, + )); + if !options.no_fail_fast { + break; } - Ok(()) => {} } }