mirror of
https://github.com/typst/typst
synced 2025-08-06 11:17:54 +08:00
refactor: fix some warnings
This commit is contained in:
parent
8c9e548cd7
commit
1b49034fb3
@ -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()
|
||||
}
|
||||
|
@ -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>;
|
||||
}
|
||||
|
@ -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 }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user