summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-11-10 01:00:22 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-12-21 15:49:42 +0100
commit917af5e39dca0c3ee84e10289e32180b234ee952 (patch)
tree6b749eed489c731d9e24aa6a517e1188117af439
parent70626c7f32b41b0a47ff12ee17a54070d45b5bdf (diff)
Use closure instead of always constructing object
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/core/imag-diagnostics/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/core/imag-diagnostics/src/lib.rs b/bin/core/imag-diagnostics/src/lib.rs
index 78161d79..5517d622 100644
--- a/bin/core/imag-diagnostics/src/lib.rs
+++ b/bin/core/imag-diagnostics/src/lib.rs
@@ -92,7 +92,7 @@ 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(),
_ => 0