mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
redundant_pattern_matching
This commit is contained in:
parent
5a62a0db46
commit
71d4dba960
17 changed files with 39 additions and 46 deletions
|
@ -271,13 +271,13 @@ fn fold_range_for_where_clause(where_clause: ast::WhereClause) -> Option<TextRan
|
|||
}
|
||||
|
||||
fn fold_range_for_multiline_match_arm(match_arm: ast::MatchArm) -> Option<TextRange> {
|
||||
if let Some(_) = fold_kind(match_arm.expr()?.syntax().kind()) {
|
||||
return None;
|
||||
if fold_kind(match_arm.expr()?.syntax().kind()).is_some() {
|
||||
None
|
||||
} else if match_arm.expr()?.syntax().text().contains_char('\n') {
|
||||
Some(match_arm.expr()?.syntax().text_range())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
if match_arm.expr()?.syntax().text().contains_char('\n') {
|
||||
return Some(match_arm.expr()?.syntax().text_range());
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue