aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-20 13:24:47 +0000
committerAleksey Kladov <[email protected]>2018-11-20 13:24:47 +0000
commitd475e3b29f1783682b2ac78459e38668bb9f8c14 (patch)
tree6d59f33e61c8693aa53d99f3b2efb56ee60ddbd1
parent3b8d0c215a922eaea182d4d72f232a534de21e33 (diff)
Make LikdId private
-rw-r--r--crates/ra_analysis/src/descriptors/module/mod.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs
index d62826ee3..8a75e11be 100644
--- a/crates/ra_analysis/src/descriptors/module/mod.rs
+++ b/crates/ra_analysis/src/descriptors/module/mod.rs
@@ -142,7 +142,7 @@ impl crate::loc2id::NumericId for ModuleId {
142} 142}
143 143
144#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] 144#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
145pub(crate) struct LinkId(u32); 145struct LinkId(u32);
146 146
147#[derive(Clone, Debug, Hash, PartialEq, Eq)] 147#[derive(Clone, Debug, Hash, PartialEq, Eq)]
148pub enum Problem { 148pub enum Problem {
@@ -159,7 +159,7 @@ impl ModuleId {
159 pub(crate) fn source(self, tree: &ModuleTree) -> ModuleSource { 159 pub(crate) fn source(self, tree: &ModuleTree) -> ModuleSource {
160 tree.module(self).source 160 tree.module(self).source
161 } 161 }
162 pub(crate) fn parent_link(self, tree: &ModuleTree) -> Option<LinkId> { 162 fn parent_link(self, tree: &ModuleTree) -> Option<LinkId> {
163 tree.module(self).parent 163 tree.module(self).parent
164 } 164 }
165 pub(crate) fn parent(self, tree: &ModuleTree) -> Option<ModuleId> { 165 pub(crate) fn parent(self, tree: &ModuleTree) -> Option<ModuleId> {
@@ -207,17 +207,13 @@ impl ModuleId {
207} 207}
208 208
209impl LinkId { 209impl LinkId {
210 pub(crate) fn owner(self, tree: &ModuleTree) -> ModuleId { 210 fn owner(self, tree: &ModuleTree) -> ModuleId {
211 tree.link(self).owner 211 tree.link(self).owner
212 } 212 }
213 pub(crate) fn name(self, tree: &ModuleTree) -> SmolStr { 213 fn name(self, tree: &ModuleTree) -> SmolStr {
214 tree.link(self).name.clone() 214 tree.link(self).name.clone()
215 } 215 }
216 pub(crate) fn bind_source<'a>( 216 fn bind_source<'a>(self, tree: &ModuleTree, db: &impl SyntaxDatabase) -> ast::ModuleNode {
217 self,
218 tree: &ModuleTree,
219 db: &impl SyntaxDatabase,
220 ) -> ast::ModuleNode {
221 let owner = self.owner(tree); 217 let owner = self.owner(tree);
222 match owner.source(tree).resolve(db) { 218 match owner.source(tree).resolve(db) {
223 ModuleSourceNode::SourceFile(root) => { 219 ModuleSourceNode::SourceFile(root) => {