mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Apply more clippy suggestions and update generated
This commit is contained in:
parent
3c6dc0f89d
commit
629e8d1ed0
11 changed files with 51 additions and 142 deletions
|
@ -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)?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue