From 4ddb5588378fc24d236780695fd59ce57f34d89b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 4 Sep 2016 17:46:32 +0200 Subject: [PATCH] Replace complex match with `if let Err(e)` --- imag-diary/src/delete.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/imag-diary/src/delete.rs b/imag-diary/src/delete.rs index 271d08a0..da06645f 100644 --- a/imag-diary/src/delete.rs +++ b/imag-diary/src/delete.rs @@ -52,9 +52,10 @@ pub fn delete(rt: &Runtime) { return; } - match diary.delete_entry(to_del) { - Ok(_) => info!("Ok"), - Err(e) => trace_error_exit(&e, 1), + if let Err(e) = diary.delete_entry(to_del) { + trace_error_exit(&e, 1) } + + info!("Ok!"); }