aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/query_definitions.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-15 16:20:31 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-15 16:20:31 +0000
commit323938dae58576f5fa86ddebf88fdcb5b09662ed (patch)
treedfeae99da99f6f9b2d91d31f84c0a3b527cfffbe /crates/ra_hir/src/query_definitions.rs
parent72a4951023f11adfdf0eac353c99d8a01a9471fc (diff)
parentfafcd103d26821a8408572514201a40765bb2d2b (diff)
Merge #555
555: remove Cancelable from ids r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r--crates/ra_hir/src/query_definitions.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs
index 8f33ec707..24cb5c752 100644
--- a/crates/ra_hir/src/query_definitions.rs
+++ b/crates/ra_hir/src/query_definitions.rs
@@ -8,7 +8,7 @@ use ra_syntax::{
8 AstNode, SyntaxNode, TreeArc, 8 AstNode, SyntaxNode, TreeArc,
9 ast::{self, ModuleItemOwner} 9 ast::{self, ModuleItemOwner}
10}; 10};
11use ra_db::{SourceRootId, Cancelable,}; 11use ra_db::SourceRootId;
12 12
13use crate::{ 13use crate::{
14 SourceFileItems, SourceItemId, DefId, HirFileId, ModuleSource, 14 SourceFileItems, SourceItemId, DefId, HirFileId, ModuleSource,
@@ -93,10 +93,7 @@ pub(super) fn input_module_items(
93 Arc::new(res) 93 Arc::new(res)
94} 94}
95 95
96pub(super) fn item_map( 96pub(super) fn item_map(db: &impl HirDatabase, source_root: SourceRootId) -> Arc<ItemMap> {
97 db: &impl HirDatabase,
98 source_root: SourceRootId,
99) -> Cancelable<Arc<ItemMap>> {
100 let start = Instant::now(); 97 let start = Instant::now();
101 let module_tree = db.module_tree(source_root); 98 let module_tree = db.module_tree(source_root);
102 let input = module_tree 99 let input = module_tree
@@ -105,8 +102,8 @@ pub(super) fn item_map(
105 .collect::<FxHashMap<_, _>>(); 102 .collect::<FxHashMap<_, _>>();
106 103
107 let resolver = Resolver::new(db, &input, source_root, module_tree); 104 let resolver = Resolver::new(db, &input, source_root, module_tree);
108 let res = resolver.resolve()?; 105 let res = resolver.resolve();
109 let elapsed = start.elapsed(); 106 let elapsed = start.elapsed();
110 log::info!("item_map: {:?}", elapsed); 107 log::info!("item_map: {:?}", elapsed);
111 Ok(Arc::new(res)) 108 Arc::new(res)
112} 109}