aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 839eb475e..56b2481e6 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -186,17 +186,18 @@ impl ModuleDef {
186 module.visibility_of(db, self) 186 module.visibility_of(db, self)
187 } 187 }
188 188
189 pub fn name(&self, db: &dyn HirDatabase) -> Option<Name> { 189 pub fn name(self, db: &dyn HirDatabase) -> Option<Name> {
190 match self { 190 match self {
191 ModuleDef::Module(m) => m.name(db), 191 ModuleDef::Adt(it) => Some(it.name(db)),
192 ModuleDef::Function(m) => Some(m.name(db)), 192 ModuleDef::Trait(it) => Some(it.name(db)),
193 ModuleDef::Adt(m) => Some(m.name(db)), 193 ModuleDef::Function(it) => Some(it.name(db)),
194 ModuleDef::EnumVariant(m) => Some(m.name(db)), 194 ModuleDef::EnumVariant(it) => Some(it.name(db)),
195 ModuleDef::Const(m) => m.name(db), 195 ModuleDef::TypeAlias(it) => Some(it.name(db)),
196 ModuleDef::Static(m) => m.name(db), 196 ModuleDef::Module(it) => it.name(db),
197 ModuleDef::Trait(m) => Some(m.name(db)), 197 ModuleDef::Const(it) => it.name(db),
198 ModuleDef::TypeAlias(m) => Some(m.name(db)), 198 ModuleDef::Static(it) => it.name(db),
199 ModuleDef::BuiltinType(m) => Some(m.as_name()), 199
200 ModuleDef::BuiltinType(it) => Some(it.as_name()),
200 } 201 }
201 } 202 }
202 203