From c8710a4d137926e81a381a38da5f15703174667e Mon Sep 17 00:00:00 2001 From: Raphael Nestler Date: Sat, 19 Nov 2016 23:05:26 +0100 Subject: [PATCH] Use map_err_into --- libimagdiary/src/diaryid.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libimagdiary/src/diaryid.rs b/libimagdiary/src/diaryid.rs index d040c725..45344778 100644 --- a/libimagdiary/src/diaryid.rs +++ b/libimagdiary/src/diaryid.rs @@ -32,6 +32,7 @@ use libimagstore::store::Result as StoreResult; use error::DiaryError as DE; use error::DiaryErrorKind as DEK; +use error::MapErrInto; use module_path::ModuleEntryPath; @@ -226,15 +227,15 @@ impl FromStoreId for DiaryId { let day: Result = next_component(&mut cmps) .and_then(|s| s.parse::() - .map_err(|e| DE::new(DEK::ParseError, Some(Box::new(e))))); + .map_err_into(DEK::ParseError)); let month: Result = next_component(&mut cmps) .and_then(|s| s.parse::() - .map_err(|e| DE::new(DEK::ParseError, Some(Box::new(e))))); + .map_err_into(DEK::ParseError)); let year: Result = next_component(&mut cmps) .and_then(|s| s.parse::() - .map_err(|e| DE::new(DEK::ParseError, Some(Box::new(e))))); + .map_err_into(DEK::ParseError)); let name = next_component(&mut cmps).map(String::from);