diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-03-05 12:13:18 +0100 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2025-03-05 12:13:29 +0100 |
| commit | 6c2c5dcb6e8f912af1c903d4ea632a9acef97268 (patch) | |
| tree | 2857704f4a5645cfdf79bc5271fd69e2e6a975b7 /src/ci | |
| parent | 6166f3d2122c7dda2ffaf0935b843da7fa40c511 (diff) | |
| download | rust-6c2c5dcb6e8f912af1c903d4ea632a9acef97268.tar.gz rust-6c2c5dcb6e8f912af1c903d4ea632a9acef97268.zip | |
Apply review remarks
Diffstat (limited to 'src/ci')
| -rw-r--r-- | src/ci/citool/src/cpu_usage.rs | 2 | ||||
| -rw-r--r-- | src/ci/citool/src/utils.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ci/citool/src/cpu_usage.rs b/src/ci/citool/src/cpu_usage.rs index 4c9e37bf6db..fa9a1203f41 100644 --- a/src/ci/citool/src/cpu_usage.rs +++ b/src/ci/citool/src/cpu_usage.rs @@ -14,6 +14,8 @@ pub fn load_cpu_usage(path: &Path) -> anyhow::Result<Vec<f64>> { if cols.len() == 2 { if let Ok(idle) = cols[1].parse::<f64>() { entries.push(100.0 - idle); + } else { + eprintln!("Warning: cannot parse CPU CSV entry {}", cols[1]); } } } diff --git a/src/ci/citool/src/utils.rs b/src/ci/citool/src/utils.rs index eb268ca397c..9cc220987bd 100644 --- a/src/ci/citool/src/utils.rs +++ b/src/ci/citool/src/utils.rs @@ -7,6 +7,5 @@ pub fn load_env_var(name: &str) -> anyhow::Result<String> { } pub fn read_to_string<P: AsRef<Path>>(path: P) -> anyhow::Result<String> { - let error = format!("Cannot read file {:?}", path.as_ref()); - std::fs::read_to_string(path).context(error) + std::fs::read_to_string(&path).with_context(|| format!("Cannot read file {:?}", path.as_ref())) } |
