diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index 083946729..d9bccd902 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -26,11 +26,7 @@ impl Module { | |||
26 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. | 26 | /// Returns a node which defines this module. That is, a file or a `mod foo {}` with items. |
27 | pub fn definition_source(self, db: &impl DefDatabase) -> InFile<ModuleSource> { | 27 | pub fn definition_source(self, db: &impl DefDatabase) -> InFile<ModuleSource> { |
28 | let def_map = db.crate_def_map(self.id.krate); | 28 | let def_map = db.crate_def_map(self.id.krate); |
29 | let src = def_map[self.id.local_id].definition_source(db); | 29 | def_map[self.id.local_id].definition_source(db) |
30 | src.map(|it| match it { | ||
31 | Either::Left(it) => ModuleSource::SourceFile(it), | ||
32 | Either::Right(it) => ModuleSource::Module(it), | ||
33 | }) | ||
34 | } | 30 | } |
35 | 31 | ||
36 | /// Returns a node which declares this module, either a `mod foo;` or a `mod foo {}`. | 32 | /// Returns a node which declares this module, either a `mod foo;` or a `mod foo {}`. |