Replace unwrap() with match
This commit is contained in:
parent
1872dcd5e6
commit
669b5a936a
1 changed files with 7 additions and 6 deletions
|
@ -79,12 +79,13 @@ impl<'a> Iterator for DiaryEntryIterator<'a> {
|
|||
|
||||
if next.is_in_diary(self.name) {
|
||||
debug!("Seems to be in diary: {:?}", next);
|
||||
let id = DiaryId::from_storeid(&next);
|
||||
if id.is_none() {
|
||||
let id = match DiaryId::from_storeid(&next) {
|
||||
Some(i) => i,
|
||||
None => {
|
||||
debug!("Couldn't parse {:?} into DiaryId", next);
|
||||
continue;
|
||||
}
|
||||
let id = id.unwrap();
|
||||
};
|
||||
debug!("Success parsing id = {:?}", id);
|
||||
|
||||
let y = match self.year { None => true, Some(y) => y == id.year() };
|
||||
|
|
Loading…
Reference in a new issue