mirror of
https://github.com/typst/typst
synced 2025-08-06 19:27:55 +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) => {
|
TagNode::Text(attrs, ids) => {
|
||||||
let tag = attrs.to_tag();
|
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);
|
let group = krilla::tagging::TagGroup::with_children(tag, children);
|
||||||
Node::Group(group)
|
Node::Group(group)
|
||||||
}
|
}
|
||||||
@ -210,10 +210,6 @@ impl TagStack {
|
|||||||
self.items.len()
|
self.items.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn last(&self) -> Option<&StackEntry> {
|
|
||||||
self.items.last()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn last_mut(&mut self) -> Option<&mut StackEntry> {
|
pub fn last_mut(&mut self) -> Option<&mut StackEntry> {
|
||||||
self.items.last_mut()
|
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> {
|
pub trait PropertyOptRef<E, T, const I: u8> {
|
||||||
fn opt_ref(&self) -> Option<&T>;
|
fn opt_ref(&self) -> Option<&T>;
|
||||||
}
|
}
|
||||||
|
@ -535,8 +535,10 @@ impl OutputType for Pdftags {
|
|||||||
Ok(doc) => doc,
|
Ok(doc) => doc,
|
||||||
Err(errors) => return Warned { output: Err(errors), warnings },
|
Err(errors) => return Warned { output: Err(errors), warnings },
|
||||||
};
|
};
|
||||||
let mut options = PdfOptions::default();
|
let options = PdfOptions {
|
||||||
options.standards = PdfStandards::new(&[PdfStandard::Ua_1]).unwrap();
|
standards: PdfStandards::new(&[PdfStandard::Ua_1]).unwrap(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
let output = typst_pdf::pdf_tags(&doc, &options).map(Pdftags);
|
let output = typst_pdf::pdf_tags(&doc, &options).map(Pdftags);
|
||||||
Warned { warnings, output }
|
Warned { warnings, output }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user