mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
concise filtering
This commit is contained in:
parent
734193bc23
commit
76e0429048
1 changed files with 1 additions and 4 deletions
|
@ -79,10 +79,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<(
|
||||||
|
|
||||||
let number_of_arguments = generics
|
let number_of_arguments = generics
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|param| match param {
|
.filter(|param| matches!(param, hir::GenericParam::TypeParam(_) | hir::GenericParam::ConstParam(_)))
|
||||||
hir::GenericParam::TypeParam(_) | hir::GenericParam::ConstParam(_) => true,
|
|
||||||
_ => false,
|
|
||||||
})
|
|
||||||
.count();
|
.count();
|
||||||
let fish_head = std::iter::repeat("_").take(number_of_arguments).collect::<Vec<_>>().join(",");
|
let fish_head = std::iter::repeat("_").take(number_of_arguments).collect::<Vec<_>>().join(",");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue