aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-11-18 13:34:46 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-11-18 13:34:46 +0000
commit57a253f3f2d62a83fa63485b2fc75fc55b300bb3 (patch)
tree0ae3a1f3c92ce9e308934e023d6a24385b4260d6 /crates/ra_analysis/src/descriptors/module
parentf1d8558cd5fe20a351496c39dbb8e15aa028803c (diff)
parent4e48917c00d24e1e1785e1959a2f3495a902410b (diff)
Merge #232
232: Add id assignment infrastructure r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
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