Save variant names in EnumData to reduce needless queries
We already have their names when anyway, and when in all (current) situations where we're interested in an Enum's variants, we want their names.
This commit is contained in:
@@ -201,7 +201,7 @@ impl Enum {
|
||||
Ok(db.enum_data(self.def_id)?.name.clone())
|
||||
}
|
||||
|
||||
pub fn variants(&self, db: &impl HirDatabase) -> Cancelable<Option<Vec<EnumVariant>>> {
|
||||
pub fn variants(&self, db: &impl HirDatabase) -> Cancelable<Vec<(Name, EnumVariant)>> {
|
||||
Ok(db.enum_data(self.def_id)?.variants.clone())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user