From cbc65ada40786f9bbe319f137b2bde2b1178bf56 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:01:16 +0100 Subject: [PATCH] fix: index --- crates/ast/src/token.rs | 2 +- crates/data-structures/src/index.rs | 2 +- crates/span/src/symbol.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ast/src/token.rs b/crates/ast/src/token.rs index ba07c1c2..f4191472 100644 --- a/crates/ast/src/token.rs +++ b/crates/ast/src/token.rs @@ -108,7 +108,7 @@ impl Lit { impl fmt::Display for Lit { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let Self { kind, symbol } = self; + let &Self { kind, symbol } = self; match kind { LitKind::Str => write!(f, "\"{symbol}\""), LitKind::UnicodeStr => write!(f, "unicode\"{symbol}\""), diff --git a/crates/data-structures/src/index.rs b/crates/data-structures/src/index.rs index 432f1506..93a33c40 100644 --- a/crates/data-structures/src/index.rs +++ b/crates/data-structures/src/index.rs @@ -44,7 +44,7 @@ macro_rules! base_index { #[inline] fn index(self) -> usize { - self.value as usize + self.get() as usize } } diff --git a/crates/span/src/symbol.rs b/crates/span/src/symbol.rs index 8059783b..ae464805 100644 --- a/crates/span/src/symbol.rs +++ b/crates/span/src/symbol.rs @@ -376,7 +376,7 @@ impl Symbol { /// Returns the internal representation of the symbol. #[inline] pub const fn as_u32(self) -> u32 { - self.0.get() - 1 + self.0.get() } /// Returns `true` if the symbol is a weak keyword and can be used in variable names.