From bf363c474834f9692b9088a2238b8f2c16603eb2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 24 Apr 2018 21:24:56 +0200 Subject: [PATCH] Use "if let" if matching on a single pattern --- lib/core/libimagstore/src/store.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index 6e78151f..57a4a7dd 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -793,12 +793,9 @@ impl<'a> Drop for FileLockEntry<'a> { fn drop(&mut self) { use libimagerror::trace::trace_error_dbg; trace!("Dropping: {:?} - from FileLockEntry::drop()", self.get_location()); - match self.store._update(self, true) { - Err(e) => { - trace_error_dbg(&e); - if_cfg_panic!("ERROR WHILE DROPPING: {:?}", e); - }, - Ok(_) => { }, + if let Err(e) = self.store._update(self, true) { + trace_error_dbg(&e); + if_cfg_panic!("ERROR WHILE DROPPING: {:?}", e); } } }