diff --git a/bin/core/imag-diagnostics/src/main.rs b/bin/core/imag-diagnostics/src/main.rs index 03d84d2a..3a1f6806 100644 --- a/bin/core/imag-diagnostics/src/main.rs +++ b/bin/core/imag-diagnostics/src/main.rs @@ -92,9 +92,9 @@ impl Diagnostic { Some(_) => "Non-String type in 'imag.version'".to_owned(), None => "No version".to_owned(), }) - .unwrap_or("Error reading version".to_owned()), + .unwrap_or_else(|_| "Error reading version".to_owned()), header_sections: match entry.get_header() { - &Value::Table(ref map) => map.keys().count(), + Value::Table(ref map) => map.keys().count(), _ => 0 }, bytecount_content: entry.get_content().as_str().len(), @@ -258,7 +258,7 @@ fn get_config(rt: &Runtime, s: &'static str) -> Option { .map_err(Error::from) .map_err_trace_exit_unwrap() .map(|opt| match opt { - &Value::String(ref s) => s.to_owned(), + Value::String(ref s) => s.to_owned(), _ => { error!("Config type wrong: 'rt.progressbar_style' should be a string"); ::std::process::exit(1)