Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
greg committed Oct 7, 2022
1 parent 34fce23 commit 48a2ff0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4866,10 +4866,10 @@ fn increment_impl(cx: &mut Context, amount: i64) {
let mut last_change_to = 0;

// Overlapping changes will panic so we keep the earliest in the document of any
// that overlap. Selection ranges in the resulting doc will be only from changes that are
// kept.
// that overlap. Selection ranges in the resulting doc will be only from changes
// that are kept.
for change in maybe_changes.into_iter() {
if changes.len() == 0 || change.0 >= last_change_to {
if changes.is_empty() || change.0 >= last_change_to {
let length_diff =
(change.2.as_ref().unwrap().len() as i128) - ((change.1 - change.0) as i128);
// Selection after increment is the first character of the new number.
Expand All @@ -4885,7 +4885,7 @@ fn increment_impl(cx: &mut Context, amount: i64) {
}
}

if changes.len() > 0 {
if !changes.is_empty() {
let new_selection_primary =
std::cmp::min(selection.primary_index(), new_selection_ranges.len() - 1);
let new_selection = Selection::new(new_selection_ranges, new_selection_primary);
Expand Down

0 comments on commit 48a2ff0

Please sign in to comment.