Skip to content

Commit

Permalink
Replace a match with if let for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
EpocSquadron authored and postsolar committed Apr 11, 2024
1 parent 3ae6662 commit 9aaac4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions helix-core/src/textobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ pub fn textobject_indentation_level(
// be selected, which is not intuitively what we want.
if !rope_is_line_ending(line) {
let indent_level = indent_level_for_line(line, tab_width, indent_width);
min_indent = match min_indent {
Some(actual_min_indent) => Some(cmp::min(indent_level, actual_min_indent)),
None => Some(indent_level),
min_indent = if let Some(prev_min_indent) = min_indent {
Some(cmp::min(indent_level, prev_min_indent))
} else {
Some(indent_level)
}
}
}
Expand Down

0 comments on commit 9aaac4e

Please sign in to comment.