File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -7,6 +7,5 @@ pub fn load_env_var(name: &str) -> anyhow::Result<String> {
77}
88
99pub 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}
You can’t perform that action at this time.
0 commit comments