Lint & format

This commit is contained in:
Andras Schmelczer 2025-04-06 11:39:40 +01:00
commit 48f301d8ab
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
9 changed files with 54 additions and 57 deletions

View file

@ -66,11 +66,9 @@ impl ExampleDocument {
result.insert(
result
.char_indices()
.skip(cursor.char_index + i)
.next()
.map(|(byte_index, _)| byte_index)
.unwrap_or_else(|| result.len()), /* find the utf8 char index of the insert
* in byte index */
.nth(cursor.char_index + i)
.map_or_else(|| result.len(), |(byte_index, _)| byte_index), /* find the utf8 char index of the insert
* in byte index */
'|',
);
}