Replace unwrap() with match

This commit is contained in:
Matthias Beyer 2016-08-04 14:12:42 +02:00
parent 76d88e46ad
commit 1872dcd5e6

View file

@ -71,12 +71,11 @@ impl<'a> Iterator for DiaryEntryIterator<'a> {
fn next(&mut self) -> Option<Result<DiaryEntry<'a>>> { fn next(&mut self) -> Option<Result<DiaryEntry<'a>>> {
loop { loop {
let next = self.iter.next(); let next = match self.iter.next() {
Some(s) => s,
None => return None,
};
debug!("Next element: {:?}", next); debug!("Next element: {:?}", next);
if next.is_none() {
return None;
}
let next = next.unwrap();
if next.is_in_diary(self.name) { if next.is_in_diary(self.name) {
debug!("Seems to be in diary: {:?}", next); debug!("Seems to be in diary: {:?}", next);