From a26a0645bd6e8433eb434cb7ffdcf0524e0ec454 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 14 May 2016 19:37:46 +0200 Subject: [PATCH] Remove iflet by mapping --- libimagstore/src/store.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 573efb82..3bbdc8a6 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -1083,11 +1083,9 @@ fn verify_header(t: &Table) -> Result<()> { } fn verify_header_consistency(t: Table) -> EntryResult { - if let Err(e) = verify_header(&t) { - Err(ParserError::new(ParserErrorKind::HeaderInconsistency, Some(Box::new(e)))) - } else { - Ok(t) - } + verify_header(&t) + .map_err(|e| ParserError::new(ParserErrorKind::HeaderInconsistency, Some(Box::new(e)))) + .map(|_| t) } fn has_only_tables(t: &Table) -> bool {