diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-26 11:57:11 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-26 11:57:11 +0000 |
commit | fbd0b772e0a56506c474c8abd5bfe049ea08d0e0 (patch) | |
tree | 7ed196ac7bdc372091afe07b9799479539c99f2c /crates/ra_hir/src/nameres.rs | |
parent | 8254244e4970b085809d42a34282649b4a4e16a2 (diff) | |
parent | f6f2d69bb8318815ff87cd1bfe504fe5aa09ed63 (diff) |
Merge #1057
1057: simplify r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/nameres.rs')
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index 93c11f271..36ef615a3 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -61,9 +61,9 @@ use ra_db::{FileId, Edition}; | |||
61 | use test_utils::tested_by; | 61 | use test_utils::tested_by; |
62 | 62 | ||
63 | use crate::{ | 63 | use crate::{ |
64 | ModuleDef, Name, Crate, Module, | 64 | ModuleDef, Name, Crate, Module, SourceItemId, |
65 | DefDatabase, Path, PathKind, HirFileId, Trait, | 65 | DefDatabase, Path, PathKind, HirFileId, Trait, |
66 | ids::{SourceItemId, SourceFileItemId, MacroCallId, MacroDefId}, | 66 | ids::{MacroCallId, MacroDefId}, |
67 | diagnostics::DiagnosticSink, | 67 | diagnostics::DiagnosticSink, |
68 | nameres::diagnostics::DefDiagnostic, | 68 | nameres::diagnostics::DefDiagnostic, |
69 | }; | 69 | }; |
@@ -241,9 +241,8 @@ impl CrateDefMap { | |||
241 | pub(crate) fn find_module_by_source( | 241 | pub(crate) fn find_module_by_source( |
242 | &self, | 242 | &self, |
243 | file_id: HirFileId, | 243 | file_id: HirFileId, |
244 | decl_id: Option<SourceFileItemId>, | 244 | decl_id: Option<SourceItemId>, |
245 | ) -> Option<CrateModuleId> { | 245 | ) -> Option<CrateModuleId> { |
246 | let decl_id = decl_id.map(|it| it.with_file_id(file_id)); | ||
247 | let (module_id, _module_data) = self.modules.iter().find(|(_module_id, module_data)| { | 246 | let (module_id, _module_data) = self.modules.iter().find(|(_module_id, module_data)| { |
248 | if decl_id.is_some() { | 247 | if decl_id.is_some() { |
249 | module_data.declaration == decl_id | 248 | module_data.declaration == decl_id |