diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/adt.rs | 21 |
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 | } |