diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-03-15 15:44:23 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-04-04 09:01:44 +0000 |
| commit | 300901b70509a0af2d971aa6f6104300da24212c (patch) | |
| tree | 1b5587d11d2fb350eb90a539154350eb02fc8bf7 /compiler/rustc_session/src | |
| parent | a1d20cf7a20eb69b7a48c9897dfd8e9a3e4b6360 (diff) | |
| download | rust-300901b70509a0af2d971aa6f6104300da24212c.tar.gz rust-300901b70509a0af2d971aa6f6104300da24212c.zip | |
Use new iteration helpers instead of manually rolling them
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 5 |
1 files changed, 1 insertions, 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<Item = (usize, Span)> + '_ { // 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] |
