From 50d5e374817823ca88913fe0ce87dcf2a7f17bc8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 14:23:00 +0300 Subject: convert some if-lets to match --- crates/ra_hir/src/adt.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'crates/ra_hir/src') 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 { } } pub fn is_struct(&self) -> bool { - if let VariantData::Struct(..) = *self { - true - } else { - false + match self { + VariantData::Struct(..) => true, + _ => false, } } pub fn is_tuple(&self) -> bool { - if let VariantData::Tuple(..) = *self { - true - } else { - false + match self { + VariantData::Tuple(..) => true, + _ => false, } } pub fn is_unit(&self) -> bool { - if let VariantData::Unit = *self { - true - } else { - false + match self { + VariantData::Unit => true, + _ => false, } } } -- cgit v1.2.3