From cb35d3a05a6e1414cfc8799d7ebd38f490c8513b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 11 Dec 2020 18:24:42 +0100 Subject: metrics: go back to `cmd!` --- xtask/src/metrics.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'xtask') diff --git a/xtask/src/metrics.rs b/xtask/src/metrics.rs index 40fc6e622..624ad3b7e 100644 --- a/xtask/src/metrics.rs +++ b/xtask/src/metrics.rs @@ -3,7 +3,6 @@ use std::{ env, io::Write as _, path::Path, - process::{Command, Stdio}, time::{Instant, SystemTime, UNIX_EPOCH}, }; @@ -82,11 +81,9 @@ impl Metrics { } fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> { eprintln!("\nMeasuring analysis-stats/{}", name); - let output = Command::new("./target/release/rust-analyzer") - .args(&["analysis-stats", "--quiet", "--memory-usage", path]) - .stderr(Stdio::inherit()) - .output()?; - let output = String::from_utf8(output.stdout)?; + let output = + cmd!("./target/release/rust-analyzer analysis-stats --quiet --memory-usage {path}") + .read()?; for (metric, value, unit) in parse_metrics(&output) { self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into()); } -- cgit v1.2.3