Skip to content

Commit 76e0429

Browse files
committed
concise filtering
1 parent 734193b commit 76e0429

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

crates/ide_assists/src/handlers/add_turbo_fish.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<(
7979

8080
let number_of_arguments = generics
8181
.iter()
82-
.filter(|param| match param {
83-
hir::GenericParam::TypeParam(_) | hir::GenericParam::ConstParam(_) => true,
84-
_ => false,
85-
})
82+
.filter(|param| matches!(param, hir::GenericParam::TypeParam(_) | hir::GenericParam::ConstParam(_)))
8683
.count();
8784
let fish_head = std::iter::repeat("_").take(number_of_arguments).collect::<Vec<_>>().join(",");
8885

0 commit comments

Comments
 (0)