We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6166f3d commit 6c2c5dcCopy full SHA for 6c2c5dc
src/ci/citool/src/cpu_usage.rs
@@ -14,6 +14,8 @@ pub fn load_cpu_usage(path: &Path) -> anyhow::Result<Vec<f64>> {
14
if cols.len() == 2 {
15
if let Ok(idle) = cols[1].parse::<f64>() {
16
entries.push(100.0 - idle);
17
+ } else {
18
+ eprintln!("Warning: cannot parse CPU CSV entry {}", cols[1]);
19
}
20
21
src/ci/citool/src/utils.rs
@@ -7,6 +7,5 @@ pub fn load_env_var(name: &str) -> anyhow::Result<String> {
7
8
9
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)
+ std::fs::read_to_string(&path).with_context(|| format!("Cannot read file {:?}", path.as_ref()))
12
0 commit comments