convert some if-lets to match
This commit is contained in:
parent
96236a9be5
commit
50d5e37481
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user