Remove if-not-else patterns (#10402)

This commit is contained in:
Joseph T. Lyons 2024-04-11 03:48:06 -04:00 committed by GitHub
parent 36a87d0f5c
commit eb6f7c1240
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 99 additions and 99 deletions

View file

@ -1326,14 +1326,7 @@ impl Buffer {
current_size: IndentSize,
new_size: IndentSize,
) -> Option<(Range<Point>, String)> {
if new_size.kind != current_size.kind {
Some((
Point::new(row, 0)..Point::new(row, current_size.len),
iter::repeat(new_size.char())
.take(new_size.len as usize)
.collect::<String>(),
))
} else {
if new_size.kind == current_size.kind {
match new_size.len.cmp(&current_size.len) {
Ordering::Greater => {
let point = Point::new(row, 0);
@ -1352,6 +1345,13 @@ impl Buffer {
Ordering::Equal => None,
}
} else {
Some((
Point::new(row, 0)..Point::new(row, current_size.len),
iter::repeat(new_size.char())
.take(new_size.len as usize)
.collect::<String>(),
))
}
}