diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-10 01:07:42 +0000 |
---|---|---|
committer | Marcus Klaas de Vries <[email protected]> | 2019-01-10 13:43:01 +0000 |
commit | e78286c8e88d31045d354320a1d29bbd75405027 (patch) | |
tree | ed4c6f986b6ede2bbafa19a66dd81f5be2d0371c /crates/ra_hir/src/code_model_api.rs | |
parent | 978de5cf8bfd2ff82696fc8d5369b41e147431c3 (diff) |
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.
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index c7d1bf0a6..725bc7d80 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -201,7 +201,7 @@ impl Enum { | |||
201 | Ok(db.enum_data(self.def_id)?.name.clone()) | 201 | Ok(db.enum_data(self.def_id)?.name.clone()) |
202 | } | 202 | } |
203 | 203 | ||
204 | pub fn variants(&self, db: &impl HirDatabase) -> Cancelable<Option<Vec<EnumVariant>>> { | 204 | pub fn variants(&self, db: &impl HirDatabase) -> Cancelable<Vec<(Name, EnumVariant)>> { |
205 | Ok(db.enum_data(self.def_id)?.variants.clone()) | 205 | Ok(db.enum_data(self.def_id)?.variants.clone()) |
206 | } | 206 | } |
207 | } | 207 | } |