Skip to content

Commit 8300eca

Browse files
committed
fixed logic with None
1 parent da22db6 commit 8300eca

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/tools/tidy/src/walk.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,15 @@ pub(crate) fn walk_no_read(
9595
f: &mut dyn FnMut(&DirEntry),
9696
) {
9797
let include_untracked = tidy_ctx.map(|flags| flags.include_untracked).unwrap_or(false);
98-
let untracked_files = match !include_untracked {
99-
true => tidy_ctx.unwrap().untracked_files.clone(),
100-
false => HashSet::new(),
98+
let untracked_files = match include_untracked {
99+
true => HashSet::new(),
100+
false => {
101+
if let Some(ctx) = tidy_ctx {
102+
ctx.untracked_files.clone()
103+
} else {
104+
HashSet::new()
105+
}
106+
}
101107
};
102108

103109
let mut walker = ignore::WalkBuilder::new(paths[0]);

0 commit comments

Comments
 (0)