diff options
author | Aleksey Kladov <[email protected]> | 2018-11-18 12:44:24 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-18 12:44:24 +0000 |
commit | cb22a799d60c6c5f81ad0f3d0361f575264f3bc2 (patch) | |
tree | 738b06fae809d32f76776d27c71fa869f5dd2544 /crates/ra_analysis/src/descriptors/module | |
parent | f1d8558cd5fe20a351496c39dbb8e15aa028803c (diff) |
Add Loc2IdMap
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/mod.rs | 9 |
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)] |
59 | pub(crate) struct ModuleId(u32); | 59 | pub(crate) struct ModuleId(u32); |
60 | 60 | ||
61 | impl 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)] |
62 | pub(crate) struct LinkId(u32); | 71 | pub(crate) struct LinkId(u32); |
63 | 72 | ||