diff --git a/lib/domain/libimagdiary/src/diaryid.rs b/lib/domain/libimagdiary/src/diaryid.rs index 0d47002e..43aab1c5 100644 --- a/lib/domain/libimagdiary/src/diaryid.rs +++ b/lib/domain/libimagdiary/src/diaryid.rs @@ -209,7 +209,7 @@ impl FromStoreId for DiaryId { let mut cmps = s.components().rev(); - let (hour, minute) = try!(next_component(&mut cmps).and_then(|time| { + let (hour, minute) = next_component(&mut cmps).and_then(|time| { let mut time = time.split(":"); let hour = time.next().and_then(|s| FromStr::from_str(s).ok()); let minute = time.next() @@ -223,7 +223,7 @@ impl FromStoreId for DiaryId { (Some(h), Some(m)) => Ok((h, m)), _ => return Err(DE::from_kind(DEK::IdParseError)), } - })); + })?; let day: Result = next_component(&mut cmps) .and_then(|s| s.parse::() @@ -244,10 +244,10 @@ impl FromStoreId for DiaryId { debug!("Year = {:?}", year); debug!("Name = {:?}", name); - let day = try!(day); - let month = try!(month); - let year = try!(year); - let name = try!(name); + let day = day?; + let month = month?; + let year = year?; + let name = name?; Ok(DiaryId::new(name, year, month, day, hour, minute)) } diff --git a/lib/domain/libimagdiary/src/viewer.rs b/lib/domain/libimagdiary/src/viewer.rs index b37061b1..cf37b8e7 100644 --- a/lib/domain/libimagdiary/src/viewer.rs +++ b/lib/domain/libimagdiary/src/viewer.rs @@ -54,10 +54,10 @@ impl DiaryViewer { Ok(id) => println!("{} :\n", id), Err(e) => trace_error(&e), } - let _ = try!(self.0 + let _ = self.0 .view_entry(&entry) .chain_err(|| DEK::ViewError) - .chain_err(|| DEK::IOError)); + .chain_err(|| DEK::IOError)?; println!("\n---\n"); }