diff options
| author | Laurenz <laurmaedje@gmail.com> | 2025-02-24 13:28:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 12:28:01 +0000 |
| commit | 69c3f957051358eff961addbcae4ff02448513dc (patch) | |
| tree | 4108c418417313d084318ffecf59cab56de32cb9 /crates/typst-library/src/text | |
| parent | ebe25432641a729780578a2440eaf9fb07c80e38 (diff) | |
Bump MSRV to 1.83 and Rust in CI to 1.85 (#5946)
Diffstat (limited to 'crates/typst-library/src/text')
| -rw-r--r-- | crates/typst-library/src/text/font/book.rs | 2 | ||||
| -rw-r--r-- | crates/typst-library/src/text/shift.rs | 2 |
2 files changed, 2 insertions, 2 deletions
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() }); } |
