Skip to content

Commit

Permalink
fix: index
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Dec 21, 2023
1 parent dcc6398 commit cbc65ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""),
Expand Down
2 changes: 1 addition & 1 deletion crates/data-structures/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ macro_rules! base_index {

#[inline]
fn index(self) -> usize {
self.value as usize
self.get() as usize
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cbc65ad

Please sign in to comment.