aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-18 12:44:24 +0000
committerAleksey Kladov <[email protected]>2018-11-18 12:44:24 +0000
commitcb22a799d60c6c5f81ad0f3d0361f575264f3bc2 (patch)
tree738b06fae809d32f76776d27c71fa869f5dd2544 /crates/ra_analysis/src/descriptors/module
parentf1d8558cd5fe20a351496c39dbb8e15aa028803c (diff)
Add Loc2IdMap
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module')
-rw-r--r--crates/ra_analysis/src/descriptors/module/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs
index bc1148b22..055a56b54 100644
--- a/crates/ra_analysis/src/descriptors/module/mod.rs
+++ b/crates/ra_analysis/src/descriptors/module/mod.rs
@@ -58,6 +58,15 @@ enum ModuleSourceNode {
58#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] 58#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
59pub(crate) struct ModuleId(u32); 59pub(crate) struct ModuleId(u32);
60 60
61impl crate::loc2id::NumericId for ModuleId {
62 fn from_u32(id: u32) -> Self {
63 ModuleId(id)
64 }
65 fn to_u32(self) -> u32 {
66 self.0
67 }
68}
69
61#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] 70#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
62pub(crate) struct LinkId(u32); 71pub(crate) struct LinkId(u32);
63 72