Skip to content

Commit 45f59f4

Browse files
committed
fix: skip directories
1 parent 8c14995 commit 45f59f4

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/workspace_traverse.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ impl Workspace {
66
walkdir::WalkDir::new(&self.path)
77
.min_depth(1)
88
.into_iter()
9-
.filter(|e| {
10-
e.is_ok()
11-
&& !e
12-
.as_ref()
13-
.unwrap()
14-
.file_name()
15-
.to_str()
16-
.unwrap_or(".")
17-
.starts_with('.')
9+
.filter(|e| match e {
10+
Ok(entry) => {
11+
!entry.file_name().to_str().unwrap_or(".").starts_with('.')
12+
&& !entry.path().is_dir()
13+
}
14+
Err(_) => false,
1815
})
1916
.map(|file| file.unwrap().into_path())
2017
.collect()

0 commit comments

Comments
 (0)