diff options
Diffstat (limited to 'helix-view/src/gutter.rs')
-rw-r--r-- | helix-view/src/gutter.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index 397dff4f..ebdac9e2 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -9,8 +9,7 @@ use crate::{ }; fn count_digits(n: usize) -> usize { - // TODO: use checked_log10 when MSRV reaches 1.67 - std::iter::successors(Some(n), |&n| (n >= 10).then_some(n / 10)).count() + (usize::checked_ilog10(n).unwrap_or(0) + 1) as usize } pub type GutterFn<'doc> = Box<dyn FnMut(usize, bool, bool, &mut String) -> Option<Style> + 'doc>; |