mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
filter_map_bool_then
This commit is contained in:
parent
575398134e
commit
c27b6b5308
2 changed files with 4 additions and 7 deletions
|
@ -400,9 +400,8 @@ impl GenericParams {
|
|||
params
|
||||
.type_or_consts
|
||||
.iter()
|
||||
.filter_map(|(idx, param)| {
|
||||
enabled(idx.into()).then(|| param.clone())
|
||||
})
|
||||
.filter(|(idx, _)| enabled((*idx).into()))
|
||||
.map(|(_, param)| param.clone())
|
||||
.collect()
|
||||
}),
|
||||
lifetimes: all_lifetimes_enabled
|
||||
|
@ -411,9 +410,8 @@ impl GenericParams {
|
|||
params
|
||||
.lifetimes
|
||||
.iter()
|
||||
.filter_map(|(idx, param)| {
|
||||
enabled(idx.into()).then(|| param.clone())
|
||||
})
|
||||
.filter(|(idx, _)| enabled((*idx).into()))
|
||||
.map(|(_, param)| param.clone())
|
||||
.collect()
|
||||
}),
|
||||
where_predicates: params.where_predicates.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue