listen to clippy

This commit is contained in:
PgBiel 2025-04-06 15:22:10 -03:00
parent fa45bf8b55
commit c90ec3c4da
3 changed files with 11 additions and 13 deletions

View File

@ -391,6 +391,7 @@ pub fn vline_stroke_at_row(
///
/// This function assumes columns are sorted by increasing `x`, and rows are
/// sorted by increasing `y`.
#[allow(clippy::too_many_arguments)]
pub fn hline_stroke_at_column(
grid: &CellGrid,
rows: &[RowPiece],

View File

@ -1,5 +1,3 @@
use std::ops::Deref;
use typst_library::diag::SourceResult;
use typst_library::engine::Engine;
use typst_library::layout::grid::resolve::{Footer, Header, Repeatable};
@ -220,14 +218,14 @@ impl<'a> GridLayouter<'a> {
HeadersToLayout::RepeatingAndPending => self.simulate_header_height(
self.repeating_headers
.iter()
.map(Deref::deref)
.chain(self.pending_headers.into_iter().map(Repeatable::unwrap)),
.copied()
.chain(self.pending_headers.iter().map(Repeatable::unwrap)),
&self.regions,
engine,
disambiguator,
)?,
HeadersToLayout::NewHeaders { headers, .. } => self.simulate_header_height(
headers.into_iter().map(Repeatable::unwrap),
headers.iter().map(Repeatable::unwrap),
&self.regions,
engine,
disambiguator,
@ -260,9 +258,8 @@ impl<'a> GridLayouter<'a> {
// when beginning a new region.
self.simulate_header_height(
self.repeating_headers
.iter()
.map(|h| *h)
.chain(self.pending_headers.into_iter().chain(headers).map(Repeatable::unwrap)),
.iter().copied()
.chain(self.pending_headers.iter().chain(headers).map(Repeatable::unwrap)),
&self.regions,
engine,
disambiguator,
@ -297,7 +294,7 @@ impl<'a> GridLayouter<'a> {
// new region to make sure row code is aware that all of those
// headers should stay together!
self.unbreakable_rows_left +=
total_header_row_count(headers.into_iter().map(Repeatable::unwrap));
total_header_row_count(headers.iter().map(Repeatable::unwrap));
}
// Need to relayout ALL headers if we skip a region, not only the
@ -306,10 +303,10 @@ impl<'a> GridLayouter<'a> {
// footers.
if matches!(headers, HeadersToLayout::RepeatingAndPending) || skipped_region {
let repeating_header_rows =
total_header_row_count(self.repeating_headers.iter().map(Deref::deref));
total_header_row_count(self.repeating_headers.iter().copied());
let pending_header_rows = total_header_row_count(
self.pending_headers.into_iter().map(Repeatable::unwrap),
self.pending_headers.iter().map(Repeatable::unwrap),
);
self.unbreakable_rows_left += repeating_header_rows + pending_header_rows;

View File

@ -1176,10 +1176,10 @@ impl<'a> RowspanSimulator<'a> {
{
// Only repeating headers have survived after the first region
// break.
let repeating_headers = layouter.repeating_headers.iter().map(|h| *h).chain(
let repeating_headers = layouter.repeating_headers.iter().copied().chain(
layouter
.pending_headers
.into_iter()
.iter()
.filter_map(Repeatable::as_repeated),
);