diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-08-30 17:19:25 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-08-30 17:19:25 +0200 |
| commit | a6f347fbb7e9d21792afe2ec8f9900ceb400ce2b (patch) | |
| tree | c768925e2bd06a5c5809b6b74b4908688ceb483c /crates | |
| parent | dacab7869fafb4963b2d9739fd982aa531ce2578 (diff) | |
Add test for ends-with fix
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/eval/str.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/crates/typst/src/eval/str.rs b/crates/typst/src/eval/str.rs index 140f7146..636b9640 100644 --- a/crates/typst/src/eval/str.rs +++ b/crates/typst/src/eval/str.rs @@ -123,14 +123,10 @@ impl Str { } // There might still be a match overlapping this one, so - // restart at the next code point - if let Some(c) = &self[mat.start()..].chars().next() { - start_byte = mat.start() + c.len_utf8(); - } else { - break; - } + // restart at the next code point. + let Some(c) = self[mat.start()..].chars().next() else { break }; + start_byte = mat.start() + c.len_utf8(); } - false } } |
