Use map_err_into

This commit is contained in:
Raphael Nestler 2016-11-19 23:05:26 +01:00
parent 24c7bbc835
commit c8710a4d13

View file

@ -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<u32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<u32>()
.map_err(|e| DE::new(DEK::ParseError, Some(Box::new(e)))));
.map_err_into(DEK::ParseError));
let month: Result<u32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<u32>()
.map_err(|e| DE::new(DEK::ParseError, Some(Box::new(e)))));
.map_err_into(DEK::ParseError));
let year: Result<i32,_> = next_component(&mut cmps)
.and_then(|s| s.parse::<i32>()
.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);