remove unused peekable

This commit is contained in:
Aleksey Kladov 2019-09-25 10:41:43 +03:00
parent 538437e829
commit f60a8734e0

View File

@ -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) {