From 5452368fad8ee8d03d980de47604fa108111ea57 Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Mon, 24 Aug 2020 21:50:30 +1200 Subject: Renames, comments, and dead code removal --- crates/hir/src/code_model.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'crates/hir/src/code_model.rs') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 9395efe4f..bd80102fa 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -43,8 +43,8 @@ use tt::{Ident, Leaf, Literal, TokenTree}; use crate::{ db::{DefDatabase, HirDatabase}, + doc_links::Resolvable, has_source::HasSource, - link_rewrite::Resolvable, HirDisplay, InFile, Name, }; @@ -234,23 +234,6 @@ impl ModuleDef { ModuleDef::BuiltinType(it) => Some(it.as_name()), } } - - pub fn resolver(&self, db: &D) -> Option { - Some(match self { - ModuleDef::Module(m) => ModuleId::from(m.clone()).resolver(db), - ModuleDef::Function(f) => FunctionId::from(f.clone()).resolver(db), - ModuleDef::Adt(adt) => AdtId::from(adt.clone()).resolver(db), - ModuleDef::EnumVariant(ev) => { - GenericDefId::from(GenericDef::from(ev.clone())).resolver(db) - } - ModuleDef::Const(c) => GenericDefId::from(GenericDef::from(c.clone())).resolver(db), - ModuleDef::Static(s) => StaticId::from(s.clone()).resolver(db), - ModuleDef::Trait(t) => TraitId::from(t.clone()).resolver(db), - ModuleDef::TypeAlias(t) => ModuleId::from(t.module(db)).resolver(db), - // FIXME: This should be a resolver relative to `std/core` - ModuleDef::BuiltinType(_t) => None?, - }) - } } pub use hir_def::{ -- cgit v1.2.3