mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Fix items_after_statements for const
s
This commit is contained in:
parent
be983fbf52
commit
82638e4dd4
1 changed files with 7 additions and 7 deletions
|
@ -283,13 +283,6 @@ fn check_tts<'a>(cx: &EarlyContext<'a>, tts: &ThinTokenStream, is_write: bool) -
|
|||
let lint = if is_write { WRITE_LITERAL } else { PRINT_LITERAL };
|
||||
let mut idx = 0;
|
||||
loop {
|
||||
if !parser.eat(&token::Comma) {
|
||||
return (Some(fmtstr), expr);
|
||||
}
|
||||
let token_expr = match parser.parse_expr().map_err(|mut err| err.cancel()) {
|
||||
Ok(expr) => expr,
|
||||
Err(_) => return (Some(fmtstr), None),
|
||||
};
|
||||
const SIMPLE: FormatSpec<'_> = FormatSpec {
|
||||
fill: None,
|
||||
align: AlignUnknown,
|
||||
|
@ -298,6 +291,13 @@ fn check_tts<'a>(cx: &EarlyContext<'a>, tts: &ThinTokenStream, is_write: bool) -
|
|||
width: CountImplied,
|
||||
ty: "",
|
||||
};
|
||||
if !parser.eat(&token::Comma) {
|
||||
return (Some(fmtstr), expr);
|
||||
}
|
||||
let token_expr = match parser.parse_expr().map_err(|mut err| err.cancel()) {
|
||||
Ok(expr) => expr,
|
||||
Err(_) => return (Some(fmtstr), None),
|
||||
};
|
||||
match &token_expr.node {
|
||||
ExprKind::Lit(_) => {
|
||||
let mut all_simple = true;
|
||||
|
|
Loading…
Reference in a new issue