From 8657d401cb1127c87a9b8d6016352a8c021dacc3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 25 Mar 2016 13:07:46 +0100 Subject: [PATCH] Add another missing newline character --- libimagutil/src/trace.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libimagutil/src/trace.rs b/libimagutil/src/trace.rs index 58a009a5..6e1a5a76 100644 --- a/libimagutil/src/trace.rs +++ b/libimagutil/src/trace.rs @@ -21,7 +21,7 @@ use std::io::stderr; /// ``` pub fn trace_error(e: &Error) { print_trace_maxdepth(count_error_causes(e), e, ::std::u64::MAX); - write!(stderr(), ""); + write!(stderr(), "\n"); } /// Print an Error type and its cause recursively, but only `max` levels @@ -47,8 +47,12 @@ pub fn trace_error_dbg(e: &Error) { /// processed. fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> { if e.cause().is_some() && idx > 0 { - print_trace_maxdepth(idx - 1, e.cause().unwrap(), max); - write!(stderr(), " -- caused:\n"); + match print_trace_maxdepth(idx - 1, e.cause().unwrap(), max) { + None => write!(stderr(), "\n"), + Some(_) => write!(stderr(), " -- caused:\n"), + }; + } else { + write!(stderr(), "\n"); } write!(stderr(), "Error {:>4} : {}", idx, e.description()); e.cause()