Replace complex match with if let Err(e)

This commit is contained in:
Matthias Beyer 2016-09-04 17:46:32 +02:00
parent 44675a4b4f
commit 4ddb558837

View file

@ -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!");
}