refactor: fix some clippy warnings

This commit is contained in:
Tobias Schmitz 2025-07-25 15:49:16 +02:00
parent e43da4b644
commit 35f44f79de
No known key found for this signature in database
4 changed files with 7 additions and 11 deletions

View File

@ -131,9 +131,7 @@ impl CompileConfig {
PageRanges::new(export_ranges.iter().map(|r| r.0.clone()).collect()) PageRanges::new(export_ranges.iter().map(|r| r.0.clone()).collect())
}); });
if args.disable_pdf_tags if args.disable_pdf_tags && args.pdf_standard.contains(&PdfStandard::Ua_1) {
&& args.pdf_standard.iter().any(|s| *s == PdfStandard::Ua_1)
{
bail!("cannot disable pdf tags when exporting a PDF/UA-1 document"); bail!("cannot disable pdf tags when exporting a PDF/UA-1 document");
} }

View File

@ -60,11 +60,9 @@ impl ListCtx {
// ``` // ```
// //
// So move the nested list out of the list item. // So move the nested list out of the list item.
if let [_, TagNode::Group(tag, _)] = nodes.as_slice() { if let [_, TagNode::Group(TagKind::L(_), _)] = nodes.as_slice() {
if let TagKind::L(_) = tag {
item.sub_list = nodes.pop(); item.sub_list = nodes.pop();
} }
}
item.body = Some(nodes); item.body = Some(nodes);
} }

View File

@ -895,7 +895,7 @@ impl BBoxCtx {
rect.max.y.to_f32(), rect.max.y.to_f32(),
) )
.unwrap(); .unwrap();
Some(BBox::new(page_idx as usize, rect)) Some(BBox::new(page_idx, rect))
} }
} }

View File

@ -211,7 +211,7 @@ impl TableCtx {
TableCellKind::Footer => Tag::TFoot.into(), TableCellKind::Footer => Tag::TFoot.into(),
TableCellKind::Data => Tag::TBody.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; chunk_kind = row_kind;
} }
@ -224,7 +224,7 @@ impl TableCtx {
TableCellKind::Footer => Tag::TFoot.into(), TableCellKind::Footer => Tag::TFoot.into(),
TableCellKind::Data => Tag::TBody.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 let tag = Tag::Table
@ -257,7 +257,7 @@ impl TableCtx {
} }
if let Some((_, cell_id)) = current_header.last() { 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()); cell.headers.push(cell_id.clone());
} }
} }