Skip to content

Commit 87ee33a

Browse files
committed
tidy: use flatten instead of manual flatten
1 parent afa7b62 commit 87ee33a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/tools/tidy/src/ui_tests.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[
5757
fn check_entries(tests_path: &Path, bad: &mut bool) {
5858
let mut directories: HashMap<PathBuf, u32> = HashMap::new();
5959

60-
for dir in Walk::new(tests_path.join("ui")) {
61-
if let Ok(entry) = dir {
62-
let parent = entry.path().parent().unwrap().to_path_buf();
63-
*directories.entry(parent).or_default() += 1;
64-
}
60+
for entry in Walk::new(tests_path.join("ui")).flatten() {
61+
let parent = entry.path().parent().unwrap().to_path_buf();
62+
*directories.entry(parent).or_default() += 1;
6563
}
6664

6765
let (mut max, mut max_issues) = (0, 0);

0 commit comments

Comments
 (0)