aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r--crates/ra_hir/src/code_model.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index a56b8ab04..b6adb7589 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -3,6 +3,7 @@ use std::sync::Arc;
3 3
4use either::Either; 4use either::Either;
5use hir_def::{ 5use hir_def::{
6 adt::StructKind,
6 adt::VariantData, 7 adt::VariantData,
7 builtin_type::BuiltinType, 8 builtin_type::BuiltinType,
8 docs::Documentation, 9 docs::Documentation,
@@ -424,6 +425,10 @@ impl EnumVariant {
424 .collect() 425 .collect()
425 } 426 }
426 427
428 pub fn kind(self, db: &impl HirDatabase) -> StructKind {
429 self.variant_data(db).kind()
430 }
431
427 pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> { 432 pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> {
428 db.enum_data(self.parent.id).variants[self.id].variant_data.clone() 433 db.enum_data(self.parent.id).variants[self.id].variant_data.clone()
429 } 434 }