Skip to content

Commit 6c2c5dc

Browse files
committed
Apply review remarks
1 parent 6166f3d commit 6c2c5dc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ci/citool/src/cpu_usage.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub fn load_cpu_usage(path: &Path) -> anyhow::Result<Vec<f64>> {
1414
if cols.len() == 2 {
1515
if let Ok(idle) = cols[1].parse::<f64>() {
1616
entries.push(100.0 - idle);
17+
} else {
18+
eprintln!("Warning: cannot parse CPU CSV entry {}", cols[1]);
1719
}
1820
}
1921
}

src/ci/citool/src/utils.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ pub fn load_env_var(name: &str) -> anyhow::Result<String> {
77
}
88

99
pub fn read_to_string<P: AsRef<Path>>(path: P) -> anyhow::Result<String> {
10-
let error = format!("Cannot read file {:?}", path.as_ref());
11-
std::fs::read_to_string(path).context(error)
10+
std::fs::read_to_string(&path).with_context(|| format!("Cannot read file {:?}", path.as_ref()))
1211
}

0 commit comments

Comments
 (0)