diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-08-04 14:13:09 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-08-04 14:13:09 +0200 |
commit | 669b5a936afc3c5db83c351d52fe24e2e00e8896 (patch) | |
tree | 7e55f85158a72d49920901210dd9764862e22792 /libimagdiary | |
parent | 1872dcd5e6a347d193d3e7a01914a777b82a7fdb (diff) |
Replace unwrap() with match
Diffstat (limited to 'libimagdiary')
-rw-r--r-- | libimagdiary/src/iter.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libimagdiary/src/iter.rs b/libimagdiary/src/iter.rs index d0ef28e5..5146e5a7 100644 --- a/libimagdiary/src/iter.rs +++ b/libimagdiary/src/iter.rs @@ -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() { - debug!("Couldn't parse {:?} into DiaryId", next); - continue; - } - let id = id.unwrap(); + let id = match DiaryId::from_storeid(&next) { + Some(i) => i, + None => { + debug!("Couldn't parse {:?} into DiaryId", next); + continue; + } + }; debug!("Success parsing id = {:?}", id); let y = match self.year { None => true, Some(y) => y == id.year() }; |