about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 0c60129494d..688a7e99f10 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -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
     }
 }