aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-08 11:23:00 +0000
committerAleksey Kladov <[email protected]>2019-01-08 11:23:00 +0000
commit50d5e374817823ca88913fe0ce87dcf2a7f17bc8 (patch)
tree025ce9be7cad6201ebe58050179fa4a7071bd062 /crates/ra_hir
parent96236a9be542be461550083373be3d0cb0bd8406 (diff)
convert some if-lets to match
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/adt.rs21
1 files changed, 9 insertions, 12 deletions
diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs
index b700be267..b75adda84 100644
--- a/crates/ra_hir/src/adt.rs
+++ b/crates/ra_hir/src/adt.rs
@@ -171,24 +171,21 @@ impl VariantData {
171 } 171 }
172 } 172 }
173 pub fn is_struct(&self) -> bool { 173 pub fn is_struct(&self) -> bool {
174 if let VariantData::Struct(..) = *self { 174 match self {
175 true 175 VariantData::Struct(..) => true,
176 } else { 176 _ => false,
177 false
178 } 177 }
179 } 178 }
180 pub fn is_tuple(&self) -> bool { 179 pub fn is_tuple(&self) -> bool {
181 if let VariantData::Tuple(..) = *self { 180 match self {
182 true 181 VariantData::Tuple(..) => true,
183 } else { 182 _ => false,
184 false
185 } 183 }
186 } 184 }
187 pub fn is_unit(&self) -> bool { 185 pub fn is_unit(&self) -> bool {
188 if let VariantData::Unit = *self { 186 match self {
189 true 187 VariantData::Unit => true,
190 } else { 188 _ => false,
191 false
192 } 189 }
193 } 190 }
194} 191}