diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-09-25 10:41:43 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-09-25 10:41:43 +0300 |
| commit | f60a8734e088f3383512b0ffc12a9a909d2163b4 (patch) | |
| tree | 05e1bbfc7b9cb55b90e5945ef0e6bb4ab4617504 | |
| parent | 538437e829fd1bdaaf5104f7750327cfdeed29bf (diff) | |
| download | rust-f60a8734e088f3383512b0ffc12a9a909d2163b4.tar.gz rust-f60a8734e088f3383512b0ffc12a9a909d2163b4.zip | |
remove unused peekable
| -rw-r--r-- | src/libsyntax/ext/mbe/quoted.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/ext/mbe/quoted.rs b/src/libsyntax/ext/mbe/quoted.rs index c881350fec3..8cb85bdef76 100644 --- a/src/libsyntax/ext/mbe/quoted.rs +++ b/src/libsyntax/ext/mbe/quoted.rs @@ -10,7 +10,6 @@ use crate::tokenstream; use syntax_pos::Span; use rustc_data_structures::sync::Lrc; -use std::iter::Peekable; /// Takes a `tokenstream::TokenStream` and returns a `Vec<self::TokenTree>`. Specifically, this /// takes a generic `TokenStream`, such as is used in the rest of the compiler, and returns a @@ -43,7 +42,7 @@ pub(super) fn parse( // For each token tree in `input`, parse the token into a `self::TokenTree`, consuming // additional trees if need be. - let mut trees = input.trees().peekable(); + let mut trees = input.trees(); while let Some(tree) = trees.next() { // Given the parsed tree, if there is a metavar and we are expecting matchers, actually // parse out the matcher (i.e., in `$id:ident` this would parse the `:` and `ident`). @@ -99,7 +98,7 @@ pub(super) fn parse( /// unstable features or not. fn parse_tree( tree: tokenstream::TokenTree, - trees: &mut Peekable<impl Iterator<Item = tokenstream::TokenTree>>, + trees: &mut impl Iterator<Item = tokenstream::TokenTree>, expect_matchers: bool, sess: &ParseSess, ) -> TokenTree { @@ -222,7 +221,7 @@ fn parse_kleene_op( /// operator and separator, then a tuple with `(separator, KleeneOp)` is returned. Otherwise, an /// error with the appropriate span is emitted to `sess` and a dummy value is returned. fn parse_sep_and_kleene_op( - input: &mut Peekable<impl Iterator<Item = tokenstream::TokenTree>>, + input: &mut impl Iterator<Item = tokenstream::TokenTree>, span: Span, sess: &ParseSess, ) -> (Option<Token>, KleeneToken) { |
