Add another missing newline character

This commit is contained in:
Matthias Beyer 2016-03-25 13:07:46 +01:00
parent 9f8a648600
commit 8657d401cb

View file

@ -21,7 +21,7 @@ use std::io::stderr;
/// ``` /// ```
pub fn trace_error(e: &Error) { pub fn trace_error(e: &Error) {
print_trace_maxdepth(count_error_causes(e), e, ::std::u64::MAX); 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 /// Print an Error type and its cause recursively, but only `max` levels
@ -47,8 +47,12 @@ pub fn trace_error_dbg(e: &Error) {
/// processed. /// processed.
fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> { fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> {
if e.cause().is_some() && idx > 0 { if e.cause().is_some() && idx > 0 {
print_trace_maxdepth(idx - 1, e.cause().unwrap(), max); match print_trace_maxdepth(idx - 1, e.cause().unwrap(), max) {
write!(stderr(), " -- caused:\n"); None => write!(stderr(), "\n"),
Some(_) => write!(stderr(), " -- caused:\n"),
};
} else {
write!(stderr(), "\n");
} }
write!(stderr(), "Error {:>4} : {}", idx, e.description()); write!(stderr(), "Error {:>4} : {}", idx, e.description());
e.cause() e.cause()