From 8b9ff46b378e37b256f6b93f1f6f3bb5bc122064 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 9 Dec 2018 12:24:52 +0300 Subject: make resolver fields private --- crates/ra_hir/src/module/nameres.rs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src/module') diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs index 6511359d0..c75c1bbea 100644 --- a/crates/ra_hir/src/module/nameres.rs +++ b/crates/ra_hir/src/module/nameres.rs @@ -200,17 +200,32 @@ impl ModuleItem { } pub(crate) struct Resolver<'a, DB> { - pub(crate) db: &'a DB, - pub(crate) input: &'a FxHashMap>, - pub(crate) source_root: SourceRootId, - pub(crate) module_tree: Arc, - pub(crate) result: ItemMap, + db: &'a DB, + input: &'a FxHashMap>, + source_root: SourceRootId, + module_tree: Arc, + result: ItemMap, } impl<'a, DB> Resolver<'a, DB> where DB: HirDatabase, { + pub(crate) fn new( + db: &'a DB, + input: &'a FxHashMap>, + source_root: SourceRootId, + module_tree: Arc, + ) -> Resolver<'a, DB> { + Resolver { + db: db, + input: &input, + source_root, + module_tree, + result: ItemMap::default(), + } + } + pub(crate) fn resolve(mut self) -> Cancelable { for (&module_id, items) in self.input.iter() { self.populate_module(module_id, items) -- cgit v1.2.3