From e6cd7bb355309ef054fbfc4edbe4da6bff6fe946 Mon Sep 17 00:00:00 2001
From: Mackiovello <elandroe@icloud.com>
Date: Sat, 7 Jul 2018 18:58:10 +0200
Subject: [PATCH] Simplify iteration even more

---
 src/command/utils.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/command/utils.rs b/src/command/utils.rs
index e48385d..fa141da 100644
--- a/src/command/utils.rs
+++ b/src/command/utils.rs
@@ -17,8 +17,7 @@ pub fn find_pkg_directory(guess_path: &str) -> Option<PathBuf> {
 
     path.read_dir().ok().and_then(|entries| {
         entries
-            .filter(|x| x.is_ok())
-            .map(|x| x.unwrap().path())
+            .filter_map(|x| x.ok().map(|v| v.path()))
             .find(|x| is_pkg_directory(&x))
     })
 }