diff options
author | Pascal Kuthe | 2023-02-09 22:27:08 +0000 |
---|---|---|
committer | GitHub | 2023-02-09 22:27:08 +0000 |
commit | 8a3ec443f176218384db8c8610bbada9c43a6ea5 (patch) | |
tree | 5b8ada854a35d6afd530a33943bfacef338d84f8 /helix-view/src/gutter.rs | |
parent | 9d73a0d1128f8237eef2d4bf475496d4db081df2 (diff) |
Fix new clippy lints (#5892)
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) } }, ) |