From d9d82d744114348918d4872adcf8e146ba91c7db Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:31:33 +0200 Subject: [PATCH] [No-auto] bin/core/diagnostics: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- bin/core/imag-diagnostics/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)