summaryrefslogtreecommitdiff
path: root/crates/typst-layout/src/grid/layouter.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-02-24 13:28:01 +0100
committerGitHub <noreply@github.com>2025-02-24 12:28:01 +0000
commit69c3f957051358eff961addbcae4ff02448513dc (patch)
tree4108c418417313d084318ffecf59cab56de32cb9 /crates/typst-layout/src/grid/layouter.rs
parentebe25432641a729780578a2440eaf9fb07c80e38 (diff)
Bump MSRV to 1.83 and Rust in CI to 1.85 (#5946)
Diffstat (limited to 'crates/typst-layout/src/grid/layouter.rs')
-rw-r--r--crates/typst-layout/src/grid/layouter.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/typst-layout/src/grid/layouter.rs b/crates/typst-layout/src/grid/layouter.rs
index 1f9cf679..af47ff72 100644
--- a/crates/typst-layout/src/grid/layouter.rs
+++ b/crates/typst-layout/src/grid/layouter.rs
@@ -1377,7 +1377,7 @@ impl<'a> GridLayouter<'a> {
.footer
.as_ref()
.and_then(Repeatable::as_repeated)
- .map_or(true, |footer| footer.start != header.end)
+ .is_none_or(|footer| footer.start != header.end)
&& self.lrows.last().is_some_and(|row| row.index() < header.end)
&& !in_last_with_offset(
self.regions,
@@ -1446,7 +1446,7 @@ impl<'a> GridLayouter<'a> {
.iter_mut()
.filter(|rowspan| (rowspan.y..rowspan.y + rowspan.rowspan).contains(&y))
.filter(|rowspan| {
- rowspan.max_resolved_row.map_or(true, |max_row| y > max_row)
+ rowspan.max_resolved_row.is_none_or(|max_row| y > max_row)
})
{
// If the first region wasn't defined yet, it will have the
@@ -1494,7 +1494,7 @@ impl<'a> GridLayouter<'a> {
// laid out at the first frame of the row).
// Any rowspans ending before this row are laid out even
// on this row's first frame.
- if laid_out_footer_start.map_or(true, |footer_start| {
+ if laid_out_footer_start.is_none_or(|footer_start| {
// If this is a footer row, then only lay out this rowspan
// if the rowspan is contained within the footer.
y < footer_start || rowspan.y >= footer_start
@@ -1580,5 +1580,5 @@ pub(super) fn points(
/// our case, headers).
pub(super) fn in_last_with_offset(regions: Regions<'_>, offset: Abs) -> bool {
regions.backlog.is_empty()
- && regions.last.map_or(true, |height| regions.size.y + offset == height)
+ && regions.last.is_none_or(|height| regions.size.y + offset == height)
}