Skip to content

Commit c33649c

Browse files
committed
Run rustfmt on quoted.rs
1 parent bb8110c commit c33649c

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

src/libsyntax/ext/tt/quoted.rs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn parse(
241241
/// - `sess`: the parsing session. Any errors will be emitted to this session.
242242
fn parse_tree<I>(
243243
tree: tokenstream::TokenTree,
244-
trees: &mut I,
244+
trees: &mut Peekable<I>,
245245
expect_matchers: bool,
246246
sess: &ParseSess,
247247
) -> TokenTree
@@ -339,15 +339,21 @@ fn kleene_op(token: &token::Token) -> Option<KleeneOp> {
339339
/// - Ok(Ok(op)) if the next token tree is a KleeneOp
340340
/// - Ok(Err(tok, span)) if the next token tree is a token but not a KleeneOp
341341
/// - Err(span) if the next token tree is not a token
342-
fn parse_kleene_op<I>(input: &mut I, span: Span) -> Result<Result<KleeneOp, (token::Token, Span)>, Span>
343-
where I: Iterator<Item = tokenstream::TokenTree>,
342+
fn parse_kleene_op<I>(
343+
input: &mut I,
344+
span: Span,
345+
) -> Result<Result<KleeneOp, (token::Token, Span)>, Span>
346+
where
347+
I: Iterator<Item = tokenstream::TokenTree>,
344348
{
345349
match input.next() {
346350
Some(tokenstream::TokenTree::Token(span, tok)) => match kleene_op(&tok) {
347351
Some(op) => Ok(Ok(op)),
348352
None => Ok(Err((tok, span))),
349-
}
350-
tree => Err(tree.as_ref().map(tokenstream::TokenTree::span).unwrap_or(span)),
353+
},
354+
tree => Err(tree.as_ref()
355+
.map(tokenstream::TokenTree::span)
356+
.unwrap_or(span)),
351357
}
352358
}
353359

@@ -363,9 +369,13 @@ fn parse_kleene_op<I>(input: &mut I, span: Span) -> Result<Result<KleeneOp, (tok
363369
/// session `sess`. If the next one (or possibly two) tokens in `input` correspond to a Kleene
364370
/// operator and separator, then a tuple with `(separator, KleeneOp)` is returned. Otherwise, an
365371
/// error with the appropriate span is emitted to `sess` and a dummy value is returned.
366-
fn parse_sep_and_kleene_op<I>(input: &mut Peekable<I>, span: Span, sess: &ParseSess)
367-
-> (Option<token::Token>, KleeneOp)
368-
where I: Iterator<Item = tokenstream::TokenTree>,
372+
fn parse_sep_and_kleene_op<I>(
373+
input: &mut Peekable<I>,
374+
span: Span,
375+
sess: &ParseSess,
376+
) -> (Option<token::Token>, KleeneOp)
377+
where
378+
I: Iterator<Item = tokenstream::TokenTree>,
369379
{
370380
// We basically look at two token trees here, denoted as #1 and #2 below
371381
let span = match parse_kleene_op(input, span) {
@@ -415,12 +425,13 @@ fn parse_sep_and_kleene_op<I>(input: &mut Peekable<I>, span: Span, sess: &ParseS
415425

416426
// #2 is not a token at all :(
417427
Err(span) => span,
418-
}
428+
},
419429

420430
// #1 is not a token
421431
Err(span) => span,
422432
};
423433

424-
sess.span_diagnostic.span_err(span, "expected one of: `*`, `+`, or `?`");
434+
sess.span_diagnostic
435+
.span_err(span, "expected one of: `*`, `+`, or `?`");
425436
(None, KleeneOp::ZeroOrMore)
426437
}

0 commit comments

Comments
 (0)