Replace unwrap() with map()

This commit is contained in:
Matthias Beyer 2016-08-04 14:10:03 +02:00
parent 9ea1811e21
commit 11dc277c6b

View file

@ -83,7 +83,7 @@ fn count_error_causes(e: &Error) -> u64 {
fn print_trace_dbg(idx: u64, e: &Error) {
debug!("{}: {}", Red.blink().paint(format!("ERROR[{:>4}]", idx)), e.description());
if e.cause().is_some() {
print_trace_dbg(idx + 1, e.cause().unwrap());
e.cause().map(|c| print_trace_dbg(idx + 1, c));
}
}