Skip to content

Commit 6324e43

Browse files
committed
Name all binaries at once
1 parent 8963f87 commit 6324e43

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

collector/src/main.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,18 @@ fn bench(
321321
}
322322

323323
fn check_measureme_installed() -> Result<(), String> {
324-
let error = |name| {
325-
format!("To run this command you need the `{0}` binary on your PATH. To install run `cargo install --git https://github.com/rust-lang/measureme --branch stable {0}`\n", name)
326-
};
327-
Command::new("summarize")
328-
.output()
329-
.map_err(|_| error("summarize"))?;
330-
Command::new("crox").output().map_err(|_| error("crox"))?;
331-
Command::new("flamegraph")
332-
.output()
333-
.map_err(|_| error("flamegraph"))?;
324+
let mut binaries = vec![];
334325

335-
Ok(())
326+
for name in ["summarize", "crox", "flamegraph"] {
327+
if let Err(_) = Command::new(name).output() {
328+
binaries.push(name);
329+
}
330+
}
331+
if binaries.is_empty() {
332+
Ok(())
333+
} else {
334+
Err(format!("To run this command you need {0} on your PATH. To install run `cargo install --git https://github.com/rust-lang/measureme --branch stable {0}`\n", binaries.join(" ")))
335+
}
336336
}
337337

338338
fn get_benchmarks(

0 commit comments

Comments
 (0)