From 300901b70509a0af2d971aa6f6104300da24212c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 15 Mar 2023 15:44:23 +0000 Subject: [PATCH] Use new iteration helpers instead of manually rolling them --- compiler/rustc_session/src/parse.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 61ce9291040..002ae1e3165 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -330,10 +330,7 @@ impl ParseSess { pub fn proc_macro_quoted_spans(&self) -> impl Iterator + '_ { // This is equivalent to `.iter().copied().enumerate()`, but that isn't possible for // AppendOnlyVec, so we resort to this scheme. - (0..) - .map(|i| (i, self.proc_macro_quoted_spans.get(i))) - .take_while(|(_, o)| o.is_some()) - .filter_map(|(i, o)| Some((i, o?))) + self.proc_macro_quoted_spans.iter_enumerated() } #[track_caller]