libstd: Prefer Option::map
/etc over match
where applicable
This commit is contained in:
parent
8dbbd81f7e
commit
4f3ab4986e
3 changed files with 6 additions and 13 deletions
|
@ -1065,10 +1065,7 @@ impl<'a> Iterator for Ancestors<'a> {
|
|||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let next = self.next;
|
||||
self.next = match next {
|
||||
Some(path) => path.parent(),
|
||||
None => None,
|
||||
};
|
||||
self.next = next.and_then(Path::parent);
|
||||
next
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue