Skip to content

Commit

Permalink
conflicts: replace "if let" with "let else"
Browse files Browse the repository at this point in the history
This makes the code a bit easier to follow in my opinion.
  • Loading branch information
scott2000 committed Nov 22, 2024
1 parent 60196fb commit 47a2bad
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/src/conflicts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ fn materialize_conflict_hunks(
format!("base #{}", base_index + 1)
};

let right1 = if let Some(right1) = hunk.get_add(add_index) {
right1
} else {
let Some(right1) = hunk.get_add(add_index) else {
// If we have no more positive terms, emit the remaining negative
// terms as snapshots.
output.write_all(CONFLICT_MINUS_LINE)?;
Expand Down

0 comments on commit 47a2bad

Please sign in to comment.