aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-01-12 20:51:56 +0000
committerFlorian Diebold <[email protected]>2019-01-12 20:51:56 +0000
commit5db5f5cc1dc5dfbded866b59570afc50538b9091 (patch)
treec03c3d5224eeb9c9a4c99e78851e209f5ffe2cd6 /crates/ra_hir/src/ty
parentd0bdaa6c00faa503db58f2a7987d1252086b4441 (diff)
Small improvements from review comments
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index ad80aa8b6..1330d03a8 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -81,23 +81,23 @@ impl CrateImplBlocks {
81 81
82 Ok(()) 82 Ok(())
83 } 83 }
84}
85 84
86pub(crate) fn impls_in_crate( 85 pub(crate) fn impls_in_crate_query(
87 db: &impl HirDatabase, 86 db: &impl HirDatabase,
88 krate: Crate, 87 krate: Crate,
89) -> Cancelable<Arc<CrateImplBlocks>> { 88 ) -> Cancelable<Arc<CrateImplBlocks>> {
90 let crate_graph = db.crate_graph(); 89 let crate_graph = db.crate_graph();
91 let file_id = crate_graph.crate_root(krate.crate_id); 90 let file_id = crate_graph.crate_root(krate.crate_id);
92 let source_root_id = db.file_source_root(file_id); 91 let source_root_id = db.file_source_root(file_id);
93 let mut crate_impl_blocks = CrateImplBlocks { 92 let mut crate_impl_blocks = CrateImplBlocks {
94 source_root_id, 93 source_root_id,
95 impls: FxHashMap::default(), 94 impls: FxHashMap::default(),
96 }; 95 };
97 if let Some(module) = krate.root_module(db)? { 96 if let Some(module) = krate.root_module(db)? {
98 crate_impl_blocks.collect_recursive(db, module)?; 97 crate_impl_blocks.collect_recursive(db, module)?;
98 }
99 Ok(Arc::new(crate_impl_blocks))
99 } 100 }
100 Ok(Arc::new(crate_impl_blocks))
101} 101}
102 102
103fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Cancelable<Option<Crate>> { 103fn def_crate(db: &impl HirDatabase, ty: &Ty) -> Cancelable<Option<Crate>> {