mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
remove trailing return in trailing match expression
This commit is contained in:
parent
cad222ff1b
commit
98e6f43a2f
3 changed files with 72 additions and 8 deletions
|
@ -272,6 +272,12 @@ impl ExprValidator {
|
|||
self.check_for_trailing_return(*else_branch, body);
|
||||
}
|
||||
}
|
||||
Expr::Match { arms, .. } => {
|
||||
for arm in arms.iter() {
|
||||
let MatchArm { expr, .. } = arm;
|
||||
self.check_for_trailing_return(*expr, body);
|
||||
}
|
||||
}
|
||||
Expr::Return { .. } => {
|
||||
self.diagnostics.push(BodyValidationDiagnostic::RemoveTrailingReturn {
|
||||
return_expr: body_expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue