diff --git a/src/draw/list_view.rs b/src/draw/list_view.rs index 81dda7a..30f74d7 100644 --- a/src/draw/list_view.rs +++ b/src/draw/list_view.rs @@ -131,19 +131,16 @@ where let match_ranges = item.match_mask.unwrap_or(&empty); fn substr<'a, 'b: 'a>(x: &'b str, r: &Range) -> &'a str { - let chars_count = x.chars().count(); let start = x .char_indices() .nth(r.start) .map(|x| x.0) - .unwrap_or_else(|| x.len()) - .min(chars_count); + .unwrap_or_else(|| x.len()); let end = x .char_indices() .nth(r.end - 1) .map(|l| l.0 + l.1.len_utf8()) - .unwrap_or_else(|| x.len()) - .min(chars_count); + .unwrap_or_else(|| x.len()); &x[start..end] }