Skip to content

Commit 54c0af6

Browse files
committed
Don't hardcode "cargo" tool name
1 parent 7e67b44 commit 54c0af6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/cargo.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ impl CargoTool {
3737
}
3838

3939
impl Tool for CargoTool {
40+
fn name(&self) -> &str {
41+
"cargo"
42+
}
43+
4044
fn find_root(&self, path: &Utf8Path) -> Result<Utf8PathBuf> {
4145
let cargo_toml_path = locate_cargo_toml(path)?;
4246
let root = cargo_toml_path

src/lab.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ pub fn test_unmutated_then_all_mutants(
6363
};
6464
if !baseline_outcome.success() {
6565
error!(
66-
"cargo {} failed in an unmutated tree, so no mutants were tested",
66+
"{} {} failed in an unmutated tree, so no mutants were tested",
67+
tool.name(),
6768
baseline_outcome.last_phase(),
6869
);
6970
// TODO: Maybe should be Err, but it would need to be an error that can map to the right

src/tool.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use crate::Result;
2121
use crate::SourceFile;
2222

2323
pub trait Tool: Debug + Send + Sync {
24+
fn name(&self) -> &str;
25+
2426
/// Find the root of the package enclosing a given path.
2527
///
2628
/// The root is the enclosing directory that needs to be copied to make a self-contained

0 commit comments

Comments
 (0)