From 11dc277c6b50eb8f65fee8a7836cf1ec633948ae Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Aug 2016 14:10:03 +0200 Subject: [PATCH] Replace unwrap() with map() --- libimagerror/src/trace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libimagerror/src/trace.rs b/libimagerror/src/trace.rs index 58a0b945..5100300f 100644 --- a/libimagerror/src/trace.rs +++ b/libimagerror/src/trace.rs @@ -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)); } }