From 0587b99fde4acf4225c024980dbde624ce6821e6 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 20 Jan 2021 15:41:18 +0100 Subject: Make public DefMap fields private --- crates/hir/src/code_model.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index a4141e111..aaa7013b6 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -90,7 +90,7 @@ impl Crate { } pub fn root_module(self, db: &dyn HirDatabase) -> Module { - let module_id = db.crate_def_map(self.id).root; + let module_id = db.crate_def_map(self.id).root(); Module::new(self, module_id) } @@ -302,7 +302,7 @@ impl Module { /// in the module tree of any target in `Cargo.toml`. pub fn crate_root(self, db: &dyn HirDatabase) -> Module { let def_map = db.crate_def_map(self.id.krate); - self.with_module_id(def_map.root) + self.with_module_id(def_map.root()) } /// Iterates over all child modules. @@ -1000,7 +1000,7 @@ impl MacroDef { /// early, in `hir_expand`, where modules simply do not exist yet. pub fn module(self, db: &dyn HirDatabase) -> Option { let krate = self.id.krate; - let module_id = db.crate_def_map(krate).root; + let module_id = db.crate_def_map(krate).root(); Some(Module::new(Crate { id: krate }, module_id)) } -- cgit v1.2.3