mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 23:24:29 +00:00
redundant_closure
This commit is contained in:
parent
3cf1358eb8
commit
5a62a0db46
4 changed files with 6 additions and 10 deletions
|
@ -177,7 +177,6 @@ needless_doctest_main = "allow"
|
|||
new_without_default = "allow"
|
||||
non_canonical_clone_impl = "allow"
|
||||
non_canonical_partial_ord_impl = "allow"
|
||||
redundant_closure = "allow"
|
||||
redundant_pattern_matching = "allow"
|
||||
search_is_some = "allow"
|
||||
self_named_constructors = "allow"
|
||||
|
|
|
@ -258,12 +258,12 @@ impl Body {
|
|||
}
|
||||
}
|
||||
Pat::Or(args) | Pat::Tuple { args, .. } | Pat::TupleStruct { args, .. } => {
|
||||
args.iter().copied().for_each(|p| f(p));
|
||||
args.iter().copied().for_each(f);
|
||||
}
|
||||
Pat::Ref { pat, .. } => f(*pat),
|
||||
Pat::Slice { prefix, slice, suffix } => {
|
||||
let total_iter = prefix.iter().chain(slice.iter()).chain(suffix.iter());
|
||||
total_iter.copied().for_each(|p| f(p));
|
||||
total_iter.copied().for_each(f);
|
||||
}
|
||||
Pat::Record { args, .. } => {
|
||||
args.iter().for_each(|RecordFieldPat { pat, .. }| f(*pat));
|
||||
|
|
|
@ -3152,7 +3152,7 @@ impl DeriveHelper {
|
|||
.and_then(|it| it.get(self.idx as usize))
|
||||
.cloned(),
|
||||
}
|
||||
.unwrap_or_else(|| Name::missing())
|
||||
.unwrap_or_else(Name::missing)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4421,7 +4421,7 @@ impl Type {
|
|||
traits_in_scope,
|
||||
with_local_impls.and_then(|b| b.id.containing_block()).into(),
|
||||
name,
|
||||
&mut |id| callback(id),
|
||||
callback,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ impl SourceToDefCtx<'_, '_> {
|
|||
pub(super) fn type_param_to_def(&mut self, src: InFile<ast::TypeParam>) -> Option<TypeParamId> {
|
||||
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
||||
let dyn_map = self.cache_for(container, src.file_id);
|
||||
dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(|it| TypeParamId::from_unchecked(it))
|
||||
dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(TypeParamId::from_unchecked)
|
||||
}
|
||||
|
||||
pub(super) fn lifetime_param_to_def(
|
||||
|
@ -326,10 +326,7 @@ impl SourceToDefCtx<'_, '_> {
|
|||
) -> Option<ConstParamId> {
|
||||
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
|
||||
let dyn_map = self.cache_for(container, src.file_id);
|
||||
dyn_map[keys::CONST_PARAM]
|
||||
.get(&src.value)
|
||||
.copied()
|
||||
.map(|it| ConstParamId::from_unchecked(it))
|
||||
dyn_map[keys::CONST_PARAM].get(&src.value).copied().map(ConstParamId::from_unchecked)
|
||||
}
|
||||
|
||||
pub(super) fn generic_param_to_def(
|
||||
|
|
Loading…
Reference in a new issue