From 6d0bcbc46a86ad0570dc304982e442acba0c58df Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 26 Mar 2025 18:13:19 +0100 Subject: [PATCH] Formatting --- crates/typst-pdf/src/convert.rs | 6 +++--- crates/typst-pdf/src/metadata.rs | 3 ++- crates/typst-pdf/src/outline.rs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/typst-pdf/src/convert.rs b/crates/typst-pdf/src/convert.rs index 0db7b8855..200d398c6 100644 --- a/crates/typst-pdf/src/convert.rs +++ b/crates/typst-pdf/src/convert.rs @@ -407,14 +407,14 @@ fn finish( let code_point = cp.map(|c| format!("{:#06x}", c as u32)); if let Some(cp) = code_point { let msg = if loc.is_some() { - "the PDF contains text with" + "the PDF contains text with" } else { - "the text contains" + "the text contains" }; error!(get_span(*loc), "{prefix} {msg} the disallowed \ codepoint {cp}") } else { - // I think this code path is in theory unreachable, + // I think this code path is in theory unreachable, // but just to be safe. let msg = if loc.is_some() { "the PDF contains text with missing codepoints" } else { "the text was not mapped to a code point" }; error!(get_span(*loc), "{prefix} {msg}"; diff --git a/crates/typst-pdf/src/metadata.rs b/crates/typst-pdf/src/metadata.rs index f6ddecd16..2829ae453 100644 --- a/crates/typst-pdf/src/metadata.rs +++ b/crates/typst-pdf/src/metadata.rs @@ -1,10 +1,11 @@ -use crate::convert::GlobalContext; use ecow::EcoString; use krilla::metadata::{Metadata, TextDirection}; use typst_library::foundations::{Datetime, Smart}; use typst_library::layout::Dir; use typst_library::text::Lang; +use crate::convert::GlobalContext; + pub(crate) fn build_metadata(gc: &GlobalContext) -> Metadata { let creator = format!("Typst {}", env!("CARGO_PKG_VERSION")); diff --git a/crates/typst-pdf/src/outline.rs b/crates/typst-pdf/src/outline.rs index 7e337b67c..e6324309f 100644 --- a/crates/typst-pdf/src/outline.rs +++ b/crates/typst-pdf/src/outline.rs @@ -1,6 +1,7 @@ +use std::num::NonZeroUsize; + use krilla::destination::XyzDestination; use krilla::outline::{Outline, OutlineNode}; -use std::num::NonZeroUsize; use typst_library::foundations::{NativeElement, Packed, StyleChain}; use typst_library::layout::Abs; use typst_library::model::HeadingElem;