Replace unwrap() with match

This commit is contained in:
Matthias Beyer 2016-08-04 14:12:42 +02:00
parent 76d88e46ad
commit 1872dcd5e6
1 changed files with 4 additions and 5 deletions

View File

@ -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);