Refactor nested for-loops into find() calls
This commit is contained in:
parent
fa99cb8269
commit
509b9478f5
1 changed files with 5 additions and 12 deletions
|
@ -617,18 +617,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
|
|
||||||
hir::ExprKind::Closure(c)
|
hir::ExprKind::Closure(c)
|
||||||
};
|
};
|
||||||
let mut parent_has_track_caller = false;
|
let parent_has_track_caller = self
|
||||||
for attrs in self.attrs.values() {
|
.attrs
|
||||||
for attr in attrs.into_iter() {
|
.values()
|
||||||
if attr.has_name(sym::track_caller) {
|
.find(|attrs| attrs.into_iter().find(|attr| attr.has_name(sym::track_caller)).is_some())
|
||||||
parent_has_track_caller = true;
|
.is_some();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if parent_has_track_caller {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let unstable_span =
|
let unstable_span =
|
||||||
self.mark_span_with_reason(DesugaringKind::Async, span, self.allow_gen_future.clone());
|
self.mark_span_with_reason(DesugaringKind::Async, span, self.allow_gen_future.clone());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue