perf: use next_back on DoubleEndedIterator

This commit is contained in:
Rolo
2025-04-03 14:37:20 -07:00
committed by Michael Davis
parent 1bc45c8b3a
commit 5b72b59448
3 changed files with 4 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ pub fn print(s: &str) -> (String, Selection) {
let head_at_beg = iter.next_if_eq(&"|").is_some();
let last_grapheme = |s: &str| {
UnicodeSegmentation::graphemes(s, true)
.last()
.next_back()
.map(String::from)
};