diff options
Diffstat (limited to 'crates/ra_ide_api/src/display')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index 1e9cdaff4..823cdaaf3 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -163,10 +163,6 @@ impl NavigationTarget { | |||
163 | NavigationTarget::from_module(db, module) | 163 | NavigationTarget::from_module(db, module) |
164 | } | 164 | } |
165 | 165 | ||
166 | pub(crate) fn from_function(db: &RootDatabase, func: hir::Function) -> NavigationTarget { | ||
167 | NavigationTarget::from_def_source(db, func) | ||
168 | } | ||
169 | |||
170 | pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget { | 166 | pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget { |
171 | let src = field.source(db); | 167 | let src = field.source(db); |
172 | let file_id = src.file_id.original_file(db); | 168 | let file_id = src.file_id.original_file(db); |
@@ -208,7 +204,7 @@ impl NavigationTarget { | |||
208 | ) -> Option<NavigationTarget> { | 204 | ) -> Option<NavigationTarget> { |
209 | let nav = match module_def { | 205 | let nav = match module_def { |
210 | hir::ModuleDef::Module(module) => NavigationTarget::from_module(db, module), | 206 | hir::ModuleDef::Module(module) => NavigationTarget::from_module(db, module), |
211 | hir::ModuleDef::Function(func) => NavigationTarget::from_function(db, func), | 207 | hir::ModuleDef::Function(func) => NavigationTarget::from_def_source(db, func), |
212 | hir::ModuleDef::Struct(it) => NavigationTarget::from_adt_def(db, it.into()), | 208 | hir::ModuleDef::Struct(it) => NavigationTarget::from_adt_def(db, it.into()), |
213 | hir::ModuleDef::Enum(it) => NavigationTarget::from_adt_def(db, it.into()), | 209 | hir::ModuleDef::Enum(it) => NavigationTarget::from_adt_def(db, it.into()), |
214 | hir::ModuleDef::Union(it) => NavigationTarget::from_adt_def(db, it.into()), | 210 | hir::ModuleDef::Union(it) => NavigationTarget::from_adt_def(db, it.into()), |
@@ -241,7 +237,7 @@ impl NavigationTarget { | |||
241 | 237 | ||
242 | pub(crate) fn from_impl_item(db: &RootDatabase, impl_item: hir::ImplItem) -> NavigationTarget { | 238 | pub(crate) fn from_impl_item(db: &RootDatabase, impl_item: hir::ImplItem) -> NavigationTarget { |
243 | match impl_item { | 239 | match impl_item { |
244 | ImplItem::Method(it) => NavigationTarget::from_function(db, it), | 240 | ImplItem::Method(it) => NavigationTarget::from_def_source(db, it), |
245 | ImplItem::Const(it) => NavigationTarget::from_def_source(db, it), | 241 | ImplItem::Const(it) => NavigationTarget::from_def_source(db, it), |
246 | ImplItem::TypeAlias(it) => NavigationTarget::from_def_source(db, it), | 242 | ImplItem::TypeAlias(it) => NavigationTarget::from_def_source(db, it), |
247 | } | 243 | } |