mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Cleaned up code based on feedback
This commit is contained in:
parent
301b8894ea
commit
5313bd1984
3 changed files with 13 additions and 16 deletions
|
@ -954,7 +954,7 @@ impl Enum {
|
|||
}
|
||||
|
||||
pub fn is_data_carrying(self, db: &dyn HirDatabase) -> bool {
|
||||
self.variants(db).iter().all(|v| matches!(v.kind(db), StructKind::Unit))
|
||||
self.variants(db).iter().any(|v| !matches!(v.kind(db), StructKind::Unit))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -966,8 +966,8 @@ impl HasVisibility for Enum {
|
|||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct Variant {
|
||||
pub parent: Enum,
|
||||
pub id: LocalEnumVariantId,
|
||||
pub(crate) parent: Enum,
|
||||
pub(crate) id: LocalEnumVariantId,
|
||||
}
|
||||
|
||||
impl Variant {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue