From 94a830cdc2c09dd068e9a5d2b51c8a99b444a33e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 29 Feb 2020 12:54:29 +0100 Subject: Fix: Also write newlines Fixes: e7e5d306458 ("Remove calls to exit() and replace them with error propagation up to main()") Signed-off-by: Matthias Beyer --- bin/core/imag-diagnostics/src/lib.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/core/imag-diagnostics/src/lib.rs b/bin/core/imag-diagnostics/src/lib.rs index 49906b28..1b3ec62b 100644 --- a/bin/core/imag-diagnostics/src/lib.rs +++ b/bin/core/imag-diagnostics/src/lib.rs @@ -199,34 +199,34 @@ impl ImagApplication for ImagDiagnostics { let mut out = rt.stdout(); - write!(out, "imag version {}", { env!("CARGO_PKG_VERSION") })?; - write!(out, "")?; - write!(out, "{} entries", n)?; + writeln!(out, "imag version {}", { env!("CARGO_PKG_VERSION") })?; + writeln!(out)?; + writeln!(out, "{} entries", n)?; for (k, v) in version_counts { - write!(out, "{} entries with store version '{}'", v, k)?; + writeln!(out, "{} entries with store version '{}'", v, k)?; } if n != 0 { - write!(out, "{} header sections in the average entry", sum_header_sections / n)?; - write!(out, "{} average content bytecount", sum_bytecount_content / n)?; - write!(out, "{} average overall bytecount", sum_overall_byte_size / n)?; + writeln!(out, "{} header sections in the average entry", sum_header_sections / n)?; + writeln!(out, "{} average content bytecount", sum_bytecount_content / n)?; + writeln!(out, "{} average overall bytecount", sum_overall_byte_size / n)?; if let Some((num, path)) = max_overall_byte_size { - write!(out, "Largest Entry ({} bytes): {}", num, path.local_display_string())?; + writeln!(out, "Largest Entry ({} bytes): {}", num, path.local_display_string())?; } - write!(out, "{} average internal link count per entry", num_links / n)?; + writeln!(out, "{} average internal link count per entry", num_links / n)?; if let Some((num, path)) = max_links { - write!(out, "Entry with most internal links ({}): {}", + writeln!(out, "Entry with most internal links ({}): {}", num, path.local_display_string())?; } - write!(out, "{} verified entries", verified_count)?; - write!(out, "{} unverified entries", unverified_count)?; + writeln!(out, "{} verified entries", verified_count)?; + writeln!(out, "{} unverified entries", unverified_count)?; if verbose { for unve in unverified_entries.iter() { - write!(out, "Unverified: {}", unve)?; + writeln!(out, "Unverified: {}", unve)?; } } } -- cgit v1.2.3