Skip to content

Commit

Permalink
style: use .filter_map() instead of .flat_map() where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Oct 2, 2024
1 parent b8bcc89 commit 5af6507
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ testutils = { path = "lib/testutils" }

[workspace.lints.clippy]
explicit_iter_loop = "deny"
flat_map_option = "deny"
implicit_clone = "deny"
redundant_else = "deny"
semicolon_if_nothing_returned = "deny"
Expand Down
2 changes: 1 addition & 1 deletion lib/src/fileset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ impl FilesetExpression {
pub fn explicit_paths(&self) -> impl Iterator<Item = &RepoPath> {
// 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,
})
Expand Down

0 comments on commit 5af6507

Please sign in to comment.