summaryrefslogtreecommitdiffstats
path: root/libimagdiary
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-08-04 14:12:42 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-08-04 14:12:42 +0200
commit1872dcd5e6a347d193d3e7a01914a777b82a7fdb (patch)
tree99019e61e8fe75ba00b8dcb6c39e0a3ec4c2b1f7 /libimagdiary
parent76d88e46adf378e6823e7540463d4d70fd281f7f (diff)
Replace unwrap() with match
Diffstat (limited to 'libimagdiary')
-rw-r--r--libimagdiary/src/iter.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/libimagdiary/src/iter.rs b/libimagdiary/src/iter.rs
index 1b2b16e5..d0ef28e5 100644
--- a/libimagdiary/src/iter.rs
+++ b/libimagdiary/src/iter.rs
@@ -71,12 +71,11 @@ impl<'a> Iterator for DiaryEntryIterator<'a> {
fn next(&mut self) -> Option<Result<DiaryEntry<'a>>> {
loop {
- let next = self.iter.next();
+ let next = match self.iter.next() {
+ Some(s) => s,
+ None => return None,
+ };
debug!("Next element: {:?}", next);
- if next.is_none() {
- return None;
- }
- let next = next.unwrap();
if next.is_in_diary(self.name) {
debug!("Seems to be in diary: {:?}", next);