Replace for_each with for
This commit is contained in:
parent
11adc1300c
commit
651215e283
3 changed files with 55 additions and 45 deletions
|
@ -1683,7 +1683,8 @@ impl<'a, 'b, 'tcx> IndexBuilder<'a, 'b, 'tcx> {
|
|||
}
|
||||
|
||||
fn encode_info_for_generics(&mut self, generics: &hir::Generics) {
|
||||
generics.params.iter().for_each(|param| match param.kind {
|
||||
for param in &generics.params {
|
||||
match param.kind {
|
||||
hir::GenericParamKind::Lifetime { .. } => {}
|
||||
hir::GenericParamKind::Type { ref default, .. } => {
|
||||
let def_id = self.tcx.hir.local_def_id(param.id);
|
||||
|
@ -1691,7 +1692,8 @@ impl<'a, 'b, 'tcx> IndexBuilder<'a, 'b, 'tcx> {
|
|||
let encode_info = IsolatedEncoder::encode_info_for_ty_param;
|
||||
self.record(def_id, encode_info, (def_id, has_default));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn encode_info_for_ty(&mut self, ty: &hir::Ty) {
|
||||
|
|
|
@ -2340,7 +2340,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
|
|||
HasTypeParameters(generics, rib_kind) => {
|
||||
let mut function_type_rib = Rib::new(rib_kind);
|
||||
let mut seen_bindings = FxHashMap();
|
||||
generics.params.iter().for_each(|param| match param.kind {
|
||||
for param in &generics.params {
|
||||
match param.kind {
|
||||
GenericParamKind::Lifetime { .. } => {}
|
||||
GenericParamKind::Type { .. } => {
|
||||
let ident = param.ident.modern();
|
||||
|
@ -2361,7 +2362,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
|
|||
function_type_rib.bindings.insert(ident, def);
|
||||
self.record_def(param.id, PathResolution::new(def));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
self.ribs[TypeNS].push(function_type_rib);
|
||||
}
|
||||
|
||||
|
|
|
@ -824,10 +824,12 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
|
|||
if let Some(ref generic_args) = seg.args {
|
||||
match **generic_args {
|
||||
ast::GenericArgs::AngleBracketed(ref data) => {
|
||||
data.args.iter().for_each(|arg| match arg {
|
||||
for arg in &data.args {
|
||||
match arg {
|
||||
ast::GenericArg::Type(ty) => self.visit_ty(ty),
|
||||
_ => {}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
ast::GenericArgs::Parenthesized(ref data) => {
|
||||
for t in &data.inputs {
|
||||
|
@ -911,10 +913,12 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
|
|||
// Explicit types in the turbo-fish.
|
||||
if let Some(ref generic_args) = seg.args {
|
||||
if let ast::GenericArgs::AngleBracketed(ref data) = **generic_args {
|
||||
data.args.iter().for_each(|arg| match arg {
|
||||
for arg in &data.args {
|
||||
match arg {
|
||||
ast::GenericArg::Type(ty) => self.visit_ty(ty),
|
||||
_ => {}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1522,7 +1526,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
|
|||
}
|
||||
|
||||
fn visit_generics(&mut self, generics: &'l ast::Generics) {
|
||||
generics.params.iter().for_each(|param| match param.kind {
|
||||
for param in &generics.params {
|
||||
match param.kind {
|
||||
ast::GenericParamKind::Lifetime { .. } => {}
|
||||
ast::GenericParamKind::Type { ref default, .. } => {
|
||||
for bound in ¶m.bounds {
|
||||
|
@ -1534,7 +1539,8 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
|
|||
self.visit_ty(&ty);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_ty(&mut self, t: &'l ast::Ty) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue