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 {