Skip to content

Commit 300901b

Browse files
committed
Use new iteration helpers instead of manually rolling them
1 parent a1d20cf commit 300901b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_session/src/parse.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,7 @@ impl ParseSess {
330330
pub fn proc_macro_quoted_spans(&self) -> impl Iterator<Item = (usize, Span)> + '_ {
331331
// This is equivalent to `.iter().copied().enumerate()`, but that isn't possible for
332332
// AppendOnlyVec, so we resort to this scheme.
333-
(0..)
334-
.map(|i| (i, self.proc_macro_quoted_spans.get(i)))
335-
.take_while(|(_, o)| o.is_some())
336-
.filter_map(|(i, o)| Some((i, o?)))
333+
self.proc_macro_quoted_spans.iter_enumerated()
337334
}
338335

339336
#[track_caller]

0 commit comments

Comments
 (0)