From 7dde21b1b6df291931cf970eacb56e9d20fa2b50 Mon Sep 17 00:00:00 2001 From: Yuwei Zhao Date: Sun, 2 Aug 2026 23:48:41 +0800 Subject: [PATCH] Inline small identifier and span helpers --- src/parser/mod.rs | 1 + src/tokenizer.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 2d51d4717..5489c972b 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -21181,6 +21181,7 @@ impl Word { /// Use this method when you need to keep the original `Word` around. /// If you can consume the `Word`, prefer [`into_ident`](Self::into_ident) instead /// to avoid cloning. + #[inline] pub fn to_ident(&self, span: Span) -> Ident { Ident { value: self.value.clone(), diff --git a/src/tokenizer.rs b/src/tokenizer.rs index badaa96e6..272ac0cbe 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -757,6 +757,7 @@ impl TokenWithSpan { } /// Wrap a token with a location from `start` to `end` + #[inline] pub fn at(token: Token, start: Location, end: Location) -> Self { Self::new(token, Span::new(start, end)) }