mirror of
https://github.com/typst/typst
synced 2025-08-03 01:37:54 +08:00
refactor: fix some clippy warnings
This commit is contained in:
parent
e43da4b644
commit
35f44f79de
@ -131,9 +131,7 @@ impl CompileConfig {
|
||||
PageRanges::new(export_ranges.iter().map(|r| r.0.clone()).collect())
|
||||
});
|
||||
|
||||
if args.disable_pdf_tags
|
||||
&& args.pdf_standard.iter().any(|s| *s == PdfStandard::Ua_1)
|
||||
{
|
||||
if args.disable_pdf_tags && args.pdf_standard.contains(&PdfStandard::Ua_1) {
|
||||
bail!("cannot disable pdf tags when exporting a PDF/UA-1 document");
|
||||
}
|
||||
|
||||
|
@ -60,10 +60,8 @@ impl ListCtx {
|
||||
// ```
|
||||
//
|
||||
// So move the nested list out of the list item.
|
||||
if let [_, TagNode::Group(tag, _)] = nodes.as_slice() {
|
||||
if let TagKind::L(_) = tag {
|
||||
item.sub_list = nodes.pop();
|
||||
}
|
||||
if let [_, TagNode::Group(TagKind::L(_), _)] = nodes.as_slice() {
|
||||
item.sub_list = nodes.pop();
|
||||
}
|
||||
|
||||
item.body = Some(nodes);
|
||||
|
@ -895,7 +895,7 @@ impl BBoxCtx {
|
||||
rect.max.y.to_f32(),
|
||||
)
|
||||
.unwrap();
|
||||
Some(BBox::new(page_idx as usize, rect))
|
||||
Some(BBox::new(page_idx, rect))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ impl TableCtx {
|
||||
TableCellKind::Footer => Tag::TFoot.into(),
|
||||
TableCellKind::Data => Tag::TBody.into(),
|
||||
};
|
||||
nodes.push(TagNode::Group(tag.into(), std::mem::take(&mut row_chunk)));
|
||||
nodes.push(TagNode::Group(tag, std::mem::take(&mut row_chunk)));
|
||||
|
||||
chunk_kind = row_kind;
|
||||
}
|
||||
@ -224,7 +224,7 @@ impl TableCtx {
|
||||
TableCellKind::Footer => Tag::TFoot.into(),
|
||||
TableCellKind::Data => Tag::TBody.into(),
|
||||
};
|
||||
nodes.push(TagNode::Group(tag.into(), row_chunk));
|
||||
nodes.push(TagNode::Group(tag, row_chunk));
|
||||
}
|
||||
|
||||
let tag = Tag::Table
|
||||
@ -257,7 +257,7 @@ impl TableCtx {
|
||||
}
|
||||
|
||||
if let Some((_, cell_id)) = current_header.last() {
|
||||
if !cell.headers.contains(&cell_id) {
|
||||
if !cell.headers.contains(cell_id) {
|
||||
cell.headers.push(cell_id.clone());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user