diff options
author | ice1000 <[email protected]> | 2019-12-05 13:28:31 +0000 |
---|---|---|
committer | ice1000 <[email protected]> | 2019-12-05 13:28:31 +0000 |
commit | 7702f690a9592605be71104ec9d0b732af940fcc (patch) | |
tree | 3ba9e21961170598f800ea24ed1f5a1a6b345ffa /crates/ra_hir/src | |
parent | 762915826ac6893036f8b5cd5e63677ed862f6d9 (diff) |
One pub function less is good!
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index a46bba4f2..18d87f6d7 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -235,11 +235,10 @@ impl Module { | |||
235 | let src_parent = InFile { file_id: src.file_id, value: parent_declaration }; | 235 | let src_parent = InFile { file_id: src.file_id, value: parent_declaration }; |
236 | Module::from_declaration(db, src_parent) | 236 | Module::from_declaration(db, src_parent) |
237 | } | 237 | } |
238 | _ => { | 238 | None => { |
239 | let src_parent = InFile { | 239 | let source_file = db.parse(src.file_id.original_file(db)).tree(); |
240 | file_id: src.file_id, | 240 | let src_parent = |
241 | value: ModuleSource::from_file_id(db, src.file_id.original_file(db)), | 241 | InFile { file_id: src.file_id, value: ModuleSource::SourceFile(source_file) }; |
242 | }; | ||
243 | Module::from_definition(db, src_parent) | 242 | Module::from_definition(db, src_parent) |
244 | } | 243 | } |
245 | }?; | 244 | }?; |