Skip to content

Commit

Permalink
Use filter_map
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Apr 30, 2024
1 parent 137cdd7 commit 9dd3c70
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cli/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,13 @@ pub fn execute(args: Args) -> miette::Result<()> {
env.tasks(Some(Platform::current()))
.into_iter()
.flat_map(|tasks| {
tasks
.into_iter()
.filter(|&(key, _)| !key.as_str().starts_with('_'))
.map(|(key, _)| key)
tasks.into_iter().filter_map(|(key, _)| {
if !key.as_str().starts_with('_') {
Some(key)
} else {
None
}
})
})
.map(ToOwned::to_owned)
})
Expand Down

0 comments on commit 9dd3c70

Please sign in to comment.