refactor: fix some warnings

This commit is contained in:
Tobias Schmitz 2025-08-05 16:38:29 +02:00
parent 8c9e548cd7
commit 1b49034fb3
No known key found for this signature in database
3 changed files with 5 additions and 23 deletions

View File

@ -148,7 +148,7 @@ impl Tags {
}
TagNode::Text(attrs, ids) => {
let tag = attrs.to_tag();
let children = ids.into_iter().map(|id| Node::Leaf(id)).collect();
let children = ids.into_iter().map(Node::Leaf).collect();
let group = krilla::tagging::TagGroup::with_children(tag, children);
Node::Group(group)
}
@ -210,10 +210,6 @@ impl TagStack {
self.items.len()
}
pub fn last(&self) -> Option<&StackEntry> {
self.items.last()
}
pub fn last_mut(&mut self) -> Option<&mut StackEntry> {
self.items.last_mut()
}

View File

@ -38,22 +38,6 @@ where
}
}
pub trait PropertyValRef<E, T, const I: u8> {
/// Get a reference to the value.
fn val_ref(&self) -> &T;
}
impl<E, T, const I: u8> PropertyValRef<E, T, I> for Settable<E, I>
where
E: NativeElement,
E: SettableProperty<I, Type = T>,
E: RefableProperty<I>,
{
fn val_ref(&self) -> &T {
self.get_ref(StyleChain::default())
}
}
pub trait PropertyOptRef<E, T, const I: u8> {
fn opt_ref(&self) -> Option<&T>;
}

View File

@ -535,8 +535,10 @@ impl OutputType for Pdftags {
Ok(doc) => doc,
Err(errors) => return Warned { output: Err(errors), warnings },
};
let mut options = PdfOptions::default();
options.standards = PdfStandards::new(&[PdfStandard::Ua_1]).unwrap();
let options = PdfOptions {
standards: PdfStandards::new(&[PdfStandard::Ua_1]).unwrap(),
..Default::default()
};
let output = typst_pdf::pdf_tags(&doc, &options).map(Pdftags);
Warned { warnings, output }
}