summaryrefslogtreecommitdiff
path: root/crates/typst-eval/src
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-11-29 16:03:08 +0100
committerGitHub <noreply@github.com>2024-11-29 15:03:08 +0000
commitd40c8ab6ab4f7051a12e5ce9433439f3a5afb99f (patch)
tree8e5b2972b1c5ede14a05ae5525c4a07fb3dda300 /crates/typst-eval/src
parent055263ee9f2253de9f176970df9d47d3b2bd2467 (diff)
Compile-time `PicoStr` interning (#5491)
Diffstat (limited to 'crates/typst-eval/src')
-rw-r--r--crates/typst-eval/src/markup.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/typst-eval/src/markup.rs b/crates/typst-eval/src/markup.rs
index 25ea5751..3a5ebe1f 100644
--- a/crates/typst-eval/src/markup.rs
+++ b/crates/typst-eval/src/markup.rs
@@ -11,6 +11,7 @@ use typst_library::text::{
LinebreakElem, RawContent, RawElem, SmartQuoteElem, SpaceElem, TextElem,
};
use typst_syntax::ast::{self, AstNode};
+use typst_utils::PicoStr;
use crate::{Eval, Vm};
@@ -204,7 +205,7 @@ impl Eval for ast::Label<'_> {
type Output = Value;
fn eval(self, _: &mut Vm) -> SourceResult<Self::Output> {
- Ok(Value::Label(Label::new(self.get())))
+ Ok(Value::Label(Label::new(PicoStr::intern(self.get()))))
}
}
@@ -212,7 +213,7 @@ impl Eval for ast::Ref<'_> {
type Output = Content;
fn eval(self, vm: &mut Vm) -> SourceResult<Self::Output> {
- let target = Label::new(self.target());
+ let target = Label::new(PicoStr::intern(self.target()));
let mut elem = RefElem::new(target);
if let Some(supplement) = self.supplement() {
elem.push_supplement(Smart::Custom(Some(Supplement::Content(