Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/hir.rs')
-rw-r--r--crates/hir-def/src/hir.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/hir-def/src/hir.rs b/crates/hir-def/src/hir.rs
index 6aca610a93..494644d8ef 100644
--- a/crates/hir-def/src/hir.rs
+++ b/crates/hir-def/src/hir.rs
@@ -56,10 +56,7 @@ impl ExprOrPatId {
}
pub fn is_expr(&self) -> bool {
- match self {
- Self::ExprId(_) => true,
- _ => false,
- }
+ matches!(self, Self::ExprId(_))
}
pub fn as_pat(self) -> Option<PatId> {
@@ -70,10 +67,7 @@ impl ExprOrPatId {
}
pub fn is_pat(&self) -> bool {
- match self {
- Self::PatId(_) => true,
- _ => false,
- }
+ matches!(self, Self::PatId(_))
}
}
stdx::impl_from!(ExprId, PatId for ExprOrPatId);