Apply more clippy suggestions and update generated

This commit is contained in:
Clemens Wasser 2021-06-03 12:46:56 +02:00
parent 3c6dc0f89d
commit 629e8d1ed0
11 changed files with 51 additions and 142 deletions

View file

@ -295,8 +295,8 @@ fn validate(pattern: &MetaTemplate) -> Result<(), ParseError> {
// Checks that no repetition which could match an empty token
// https://github.com/rust-lang/rust/blob/a58b1ed44f5e06976de2bdc4d7dc81c36a96934f/src/librustc_expand/mbe/macro_rules.rs#L558
if separator.is_none() {
if subtree.iter().all(|child_op| {
if separator.is_none()
&& subtree.iter().all(|child_op| {
match child_op {
Op::Var { kind, .. } => {
// vis is optional
@ -314,9 +314,9 @@ fn validate(pattern: &MetaTemplate) -> Result<(), ParseError> {
Op::Subtree { .. } => {}
}
false
}) {
return Err(ParseError::RepetitionEmptyTokenTree);
}
})
{
return Err(ParseError::RepetitionEmptyTokenTree);
}
validate(subtree)?
}