use matches! macro in more places
This commit is contained in:
parent
e6e956dade
commit
bcc15bba95
13 changed files with 52 additions and 75 deletions
|
@ -1298,17 +1298,17 @@ impl Expr {
|
|||
|
||||
/// To a first-order approximation, is this a pattern?
|
||||
pub fn is_approximately_pattern(&self) -> bool {
|
||||
match &self.peel_parens().kind {
|
||||
matches!(
|
||||
&self.peel_parens().kind,
|
||||
ExprKind::Array(_)
|
||||
| ExprKind::Call(_, _)
|
||||
| ExprKind::Tup(_)
|
||||
| ExprKind::Lit(_)
|
||||
| ExprKind::Range(_, _, _)
|
||||
| ExprKind::Underscore
|
||||
| ExprKind::Path(_, _)
|
||||
| ExprKind::Struct(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
| ExprKind::Call(_, _)
|
||||
| ExprKind::Tup(_)
|
||||
| ExprKind::Lit(_)
|
||||
| ExprKind::Range(_, _, _)
|
||||
| ExprKind::Underscore
|
||||
| ExprKind::Path(_, _)
|
||||
| ExprKind::Struct(_)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue