summaryrefslogtreecommitdiff
path: root/crates/typst-pdf/src/named_destination.rs
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-pdf/src/named_destination.rs
parent055263ee9f2253de9f176970df9d47d3b2bd2467 (diff)
Compile-time `PicoStr` interning (#5491)
Diffstat (limited to 'crates/typst-pdf/src/named_destination.rs')
-rw-r--r--crates/typst-pdf/src/named_destination.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-pdf/src/named_destination.rs b/crates/typst-pdf/src/named_destination.rs
index 90552335..7ae2c5e6 100644
--- a/crates/typst-pdf/src/named_destination.rs
+++ b/crates/typst-pdf/src/named_destination.rs
@@ -53,12 +53,12 @@ pub fn write_named_destinations(
.collect();
// Named destinations must be sorted by key.
- matches.sort_by_key(|&(_, label)| label);
+ matches.sort_by_key(|&(_, label)| label.resolve());
for (loc, label) in matches {
// Don't encode named destinations that would exceed the limit. Those
// will instead be encoded as normal links.
- if label.as_str().len() > Str::PDFA_LIMIT {
+ if label.resolve().len() > Str::PDFA_LIMIT {
continue;
}