diff options
Diffstat (limited to 'helix-view/src/gutter.rs')
-rw-r--r-- | helix-view/src/gutter.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index 90c94d55..cb9e4333 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -7,9 +7,8 @@ use crate::{ }; fn count_digits(n: usize) -> usize { - // NOTE: if int_log gets standardized in stdlib, can use checked_log10 - // (https://github.com/rust-lang/rust/issues/70887#issue) - std::iter::successors(Some(n), |&n| (n >= 10).then(|| n / 10)).count() + // TODO: use checked_log10 when MSRV reaches 1.67 + std::iter::successors(Some(n), |&n| (n >= 10).then_some(n / 10)).count() } pub type GutterFn<'doc> = Box<dyn FnMut(usize, bool, bool, &mut String) -> Option<Style> + 'doc>; @@ -199,8 +198,7 @@ pub fn line_numbers<'doc>( write!(out, "{:>1$}", " ", width).unwrap(); } - // TODO: Use then_some when MSRV reaches 1.62 - first_visual_line.then(|| style) + first_visual_line.then_some(style) } }, ) |