-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E0011 #85
E0011 #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
let flatten_statements = self.travers_statements_to_validate(vec![].clone(), statement); | ||
for statement in flatten_statements { | ||
match statement { | ||
Statement::Expression(ExpressionStatement { expression, ending }) => { |
Check warning
Code scanning / clippy
unused variable: ending Warning
} | ||
} | ||
Statement::Return(ReturnStatement { | ||
r#return, |
Check warning
Code scanning / clippy
unused variable: return Warning
Statement::Return(ReturnStatement { | ||
r#return, | ||
value, | ||
ending, |
Check warning
Code scanning / clippy
unused variable: ending Warning
String::from(DESCRIPTION) | ||
} | ||
|
||
fn validate(&self, file: &File, statement: &Statement) -> Vec<Violation> { |
Check warning
Code scanning / clippy
unused variable: file Warning
let flatten_statements = self.travers_statements_to_validate(vec![].clone(), statement); | ||
for statement in flatten_statements { | ||
match statement { | ||
Statement::Expression(ExpressionStatement { expression, ending }) => { |
Check warning
Code scanning / clippy
unused variable: ending Warning
value, | ||
ending, | ||
}) => match value { | ||
Some(Expression::ErrorSuppress(ErrorSuppressExpression { at, expr })) => { |
Check warning
Code scanning / clippy
unused variable: expr Warning
match expression { | ||
Expression::ErrorSuppress(ErrorSuppressExpression { at, expr }) => { | ||
let suggestion = "Error supression(@) symbol found. Remove it.".to_string(); | ||
violation.push(Violation { | ||
rule: String::from(CODE), | ||
line: at.line.to_string(), | ||
suggestion, | ||
span: *at, | ||
}); | ||
} | ||
_ => {} | ||
} |
Check warning
Code scanning / clippy
this match can be collapsed into the outer match Warning
}) => match value { | ||
Some(Expression::ErrorSuppress(ErrorSuppressExpression { at, expr })) => { | ||
let suggestion = "Error supression(@) symbol found. Remove it. ".to_string(); | ||
violation.push(Violation { | ||
rule: String::from(CODE), | ||
line: at.line.to_string(), | ||
suggestion, | ||
span: *at, | ||
}); | ||
} | ||
_ => {} | ||
}, |
Check warning
Code scanning / clippy
this match can be collapsed into the outer match Warning
match expression { | ||
Expression::ErrorSuppress(ErrorSuppressExpression { at, expr }) => { | ||
let suggestion = "Error supression(@) symbol found. Remove it.".to_string(); | ||
violation.push(Violation { | ||
rule: String::from(CODE), | ||
line: at.line.to_string(), | ||
suggestion, | ||
span: *at, | ||
}); | ||
} | ||
_ => {} | ||
} |
Check warning
Code scanning / clippy
you seem to be trying to use match for destructuring a single pattern. Consider using if let Warning
}) => match value { | ||
Some(Expression::ErrorSuppress(ErrorSuppressExpression { at, expr })) => { | ||
let suggestion = "Error supression(@) symbol found. Remove it. ".to_string(); | ||
violation.push(Violation { | ||
rule: String::from(CODE), | ||
line: at.line.to_string(), | ||
suggestion, | ||
span: *at, | ||
}); | ||
} | ||
_ => {} | ||
}, |
Check warning
Code scanning / clippy
you seem to be trying to use match for destructuring a single pattern. Consider using if let Warning
No description provided.