mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Refactor nested for-loops into find() calls
This commit is contained in:
parent
fa99cb8269
commit
509b9478f5
@ -617,18 +617,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||
|
||||
hir::ExprKind::Closure(c)
|
||||
};
|
||||
let mut parent_has_track_caller = false;
|
||||
for attrs in self.attrs.values() {
|
||||
for attr in attrs.into_iter() {
|
||||
if attr.has_name(sym::track_caller) {
|
||||
parent_has_track_caller = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if parent_has_track_caller {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let parent_has_track_caller = self
|
||||
.attrs
|
||||
.values()
|
||||
.find(|attrs| attrs.into_iter().find(|attr| attr.has_name(sym::track_caller)).is_some())
|
||||
.is_some();
|
||||
let unstable_span =
|
||||
self.mark_span_with_reason(DesugaringKind::Async, span, self.allow_gen_future.clone());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user