This commit is contained in:
OleStrohm 2022-09-12 21:02:30 +01:00
parent 5313bd1984
commit 177ec82a41
3 changed files with 21 additions and 1 deletions

View file

@ -964,6 +964,12 @@ impl HasVisibility for Enum {
}
}
impl From<&Variant> for DefWithBodyId {
fn from(&v: &Variant) -> Self {
DefWithBodyId::VariantId(v.into())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Variant {
pub(crate) parent: Enum,
@ -1179,6 +1185,7 @@ impl DefWithBody {
DefWithBody::Function(it) => it.id.into(),
DefWithBody::Static(it) => it.id.into(),
DefWithBody::Const(it) => it.id.into(),
DefWithBody::Variant(it) => it.into(),
}
}