diff options
Diffstat (limited to 'crates/ra_ide_api/src/navigation_target.rs')
-rw-r--r-- | crates/ra_ide_api/src/navigation_target.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/navigation_target.rs b/crates/ra_ide_api/src/navigation_target.rs index 617908aed..a2e4b6506 100644 --- a/crates/ra_ide_api/src/navigation_target.rs +++ b/crates/ra_ide_api/src/navigation_target.rs | |||
@@ -72,10 +72,7 @@ impl NavigationTarget { | |||
72 | 72 | ||
73 | pub(crate) fn from_module(db: &RootDatabase, module: hir::Module) -> NavigationTarget { | 73 | pub(crate) fn from_module(db: &RootDatabase, module: hir::Module) -> NavigationTarget { |
74 | let (file_id, source) = module.definition_source(db); | 74 | let (file_id, source) = module.definition_source(db); |
75 | let name = module | 75 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
76 | .name(db) | ||
77 | .map(|it| it.to_string().into()) | ||
78 | .unwrap_or_default(); | ||
79 | match source { | 76 | match source { |
80 | ModuleSource::SourceFile(node) => { | 77 | ModuleSource::SourceFile(node) => { |
81 | NavigationTarget::from_syntax(file_id, name, None, node.syntax()) | 78 | NavigationTarget::from_syntax(file_id, name, None, node.syntax()) |
@@ -87,10 +84,7 @@ impl NavigationTarget { | |||
87 | } | 84 | } |
88 | 85 | ||
89 | pub(crate) fn from_module_to_decl(db: &RootDatabase, module: hir::Module) -> NavigationTarget { | 86 | pub(crate) fn from_module_to_decl(db: &RootDatabase, module: hir::Module) -> NavigationTarget { |
90 | let name = module | 87 | let name = module.name(db).map(|it| it.to_string().into()).unwrap_or_default(); |
91 | .name(db) | ||
92 | .map(|it| it.to_string().into()) | ||
93 | .unwrap_or_default(); | ||
94 | if let Some((file_id, source)) = module.declaration_source(db) { | 88 | if let Some((file_id, source)) = module.declaration_source(db) { |
95 | return NavigationTarget::from_syntax(file_id, name, None, source.syntax()); | 89 | return NavigationTarget::from_syntax(file_id, name, None, source.syntax()); |
96 | } | 90 | } |