From fa44e286f440b210a9c340d9ccc12ef6e7b0e341 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 2 Oct 2024 23:27:54 +0200 Subject: [PATCH] style: use `.filter_map()` instead of `.flat_map()` where appropriate --- Cargo.toml | 1 + lib/src/fileset.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 50062118d3f..98c04a3540a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -134,6 +134,7 @@ testutils = { path = "lib/testutils" } [workspace.lints.clippy] explicit_iter_loop = "deny" +flat_map_option = "deny" implicit_clone = "deny" semicolon_if_nothing_returned = "deny" uninlined_format_args = "deny" diff --git a/lib/src/fileset.rs b/lib/src/fileset.rs index dae932a6f95..18b78ad2888 100644 --- a/lib/src/fileset.rs +++ b/lib/src/fileset.rs @@ -297,7 +297,7 @@ impl FilesetExpression { pub fn explicit_paths(&self) -> impl Iterator { // pre/post-ordering doesn't matter so long as children are visited from // left to right. - self.dfs_pre().flat_map(|expr| match expr { + self.dfs_pre().filter_map(|expr| match expr { FilesetExpression::Pattern(pattern) => pattern.as_path(), _ => None, })