Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/lib.rs')
| -rw-r--r-- | crates/span/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/span/src/lib.rs b/crates/span/src/lib.rs index 09af34ce7e..7341a529a6 100644 --- a/crates/span/src/lib.rs +++ b/crates/span/src/lib.rs @@ -97,6 +97,14 @@ impl SyntaxContextId { pub fn is_root(self) -> bool { self == Self::ROOT } + + pub fn into_u32(self) -> u32 { + self.0.as_u32() + } + + pub fn from_u32(u32: u32) -> Self { + Self(InternId::from(u32)) + } } #[derive(Copy, Clone, PartialEq, Eq, Hash)] |