convert some if-lets to match

This commit is contained in:
Aleksey Kladov 2019-01-08 14:23:00 +03:00
parent 96236a9be5
commit 50d5e37481

View File

@ -171,24 +171,21 @@ pub fn fields(&self) -> &[StructField] {
}
}
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,
}
}
}