diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-08 11:23:43 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-08 11:23:43 +0000 |
commit | d70ccebcf12253d4028fba6e4717c87ca1c397cd (patch) | |
tree | 025ce9be7cad6201ebe58050179fa4a7071bd062 /crates/ra_hir/src/adt.rs | |
parent | 1e0948a509e8f6ec7cbb5e2ef77669325fee0637 (diff) | |
parent | 50d5e374817823ca88913fe0ce87dcf2a7f17bc8 (diff) |
Merge #454
454: If-let to match r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/adt.rs')
-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 | } |