Refactor: use map_err_into() instead of manual building
This commit is contained in:
parent
f8db1273e7
commit
44675a4b4f
1 changed files with 2 additions and 3 deletions
|
@ -2,8 +2,8 @@ use std::process::exit;
|
|||
|
||||
use libimagdiary::diary::Diary;
|
||||
use libimagdiary::diaryid::DiaryId;
|
||||
use libimagdiary::error::DiaryError as DE;
|
||||
use libimagdiary::error::DiaryErrorKind as DEK;
|
||||
use libimagdiary::error::MapErrInto;
|
||||
use libimagentryedit::edit::Edit;
|
||||
use libimagrt::runtime::Runtime;
|
||||
use libimagerror::trace::trace_error;
|
||||
|
@ -98,8 +98,7 @@ pub fn create(rt: &Runtime) {
|
|||
Ok(())
|
||||
} else {
|
||||
debug!("Editing new diary entry");
|
||||
entry.edit_content(rt)
|
||||
.map_err(|e| DE::new(DEK::DiaryEditError, Some(Box::new(e))))
|
||||
entry.edit_content(rt).map_err_into(DEK::DiaryEditError)
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue