Replace unwrap() with match
This commit is contained in:
parent
76d88e46ad
commit
1872dcd5e6
1 changed files with 4 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue