summaryrefslogtreecommitdiff
path: root/crates/typst-library/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-library/src')
-rw-r--r--crates/typst-library/src/foundations/symbol.rs2
-rw-r--r--crates/typst-library/src/layout/grid/resolve.rs2
-rw-r--r--crates/typst-library/src/text/font/book.rs2
-rw-r--r--crates/typst-library/src/text/shift.rs2
4 files changed, 4 insertions, 4 deletions
diff --git a/crates/typst-library/src/foundations/symbol.rs b/crates/typst-library/src/foundations/symbol.rs
index 2c391ee4..50fcfb40 100644
--- a/crates/typst-library/src/foundations/symbol.rs
+++ b/crates/typst-library/src/foundations/symbol.rs
@@ -411,7 +411,7 @@ fn find<'a>(
}
let score = (matching, Reverse(total));
- if best_score.map_or(true, |b| score > b) {
+ if best_score.is_none_or(|b| score > b) {
best = Some(candidate.1);
best_score = Some(score);
}
diff --git a/crates/typst-library/src/layout/grid/resolve.rs b/crates/typst-library/src/layout/grid/resolve.rs
index 762f94ed..08d0130d 100644
--- a/crates/typst-library/src/layout/grid/resolve.rs
+++ b/crates/typst-library/src/layout/grid/resolve.rs
@@ -1387,7 +1387,7 @@ impl<'a> CellGrid<'a> {
// Include the gutter right before the footer, unless there is
// none, or the gutter is already included in the header (no
// rows between the header and the footer).
- if header_end.map_or(true, |header_end| header_end != footer.start) {
+ if header_end != Some(footer.start) {
footer.start = footer.start.saturating_sub(1);
}
}
diff --git a/crates/typst-library/src/text/font/book.rs b/crates/typst-library/src/text/font/book.rs
index 23e27f64..9f8acce8 100644
--- a/crates/typst-library/src/text/font/book.rs
+++ b/crates/typst-library/src/text/font/book.rs
@@ -160,7 +160,7 @@ impl FontBook {
current.variant.weight.distance(variant.weight),
);
- if best_key.map_or(true, |b| key < b) {
+ if best_key.is_none_or(|b| key < b) {
best = Some(id);
best_key = Some(key);
}
diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs
index 3eec0758..dbf1be8a 100644
--- a/crates/typst-library/src/text/shift.rs
+++ b/crates/typst-library/src/text/shift.rs
@@ -159,7 +159,7 @@ fn is_shapable(engine: &Engine, text: &str, styles: StyleChain) -> bool {
{
let covers = family.covers();
return text.chars().all(|c| {
- covers.map_or(true, |cov| cov.is_match(c.encode_utf8(&mut [0; 4])))
+ covers.is_none_or(|cov| cov.is_match(c.encode_utf8(&mut [0; 4])))
&& font.ttf().glyph_index(c).is_some()
});
}