mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
convert some if-lets to match
This commit is contained in:
parent
96236a9be5
commit
50d5e37481
1 changed files with 9 additions and 12 deletions
|
@ -171,24 +171,21 @@ impl VariantData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn is_struct(&self) -> bool {
|
pub fn is_struct(&self) -> bool {
|
||||||
if let VariantData::Struct(..) = *self {
|
match self {
|
||||||
true
|
VariantData::Struct(..) => true,
|
||||||
} else {
|
_ => false,
|
||||||
false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn is_tuple(&self) -> bool {
|
pub fn is_tuple(&self) -> bool {
|
||||||
if let VariantData::Tuple(..) = *self {
|
match self {
|
||||||
true
|
VariantData::Tuple(..) => true,
|
||||||
} else {
|
_ => false,
|
||||||
false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn is_unit(&self) -> bool {
|
pub fn is_unit(&self) -> bool {
|
||||||
if let VariantData::Unit = *self {
|
match self {
|
||||||
true
|
VariantData::Unit => true,
|
||||||
} else {
|
_ => false,
|
||||||
false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue