From 4f3ab4986ec96d9c93f34dc53d0a4a1279288451 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 23 Jul 2018 22:00:51 -0700 Subject: libstd: Prefer `Option::map`/etc over `match` where applicable --- src/libstd/path.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/libstd/path.rs') 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 { let next = self.next; - self.next = match next { - Some(path) => path.parent(), - None => None, - }; + self.next = next.and_then(Path::parent); next } } -- cgit 1.4.1-3-g733a5