From cb22a799d60c6c5f81ad0f3d0361f575264f3bc2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 18 Nov 2018 15:44:24 +0300 Subject: Add Loc2IdMap --- crates/ra_analysis/src/descriptors/module/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/ra_analysis/src/descriptors/module') 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 { #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] pub(crate) struct ModuleId(u32); +impl crate::loc2id::NumericId for ModuleId { + fn from_u32(id: u32) -> Self { + ModuleId(id) + } + fn to_u32(self) -> u32 { + self.0 + } +} + #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] pub(crate) struct LinkId(u32); -- cgit v1.2.3