Skip to content

Commit

Permalink
Remove an unnecessary else
Browse files Browse the repository at this point in the history
The if block above always returns, acting as a guard, so there's no
reason for an else here.
  • Loading branch information
braddunbar committed Jan 20, 2024
1 parent 0864aea commit 10ca02f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bytes_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,11 @@ impl BytesMut {
}

return;
} else {
new_cap = cmp::max(new_cap, original_capacity);
}
}

new_cap = cmp::max(new_cap, original_capacity);

// Create a new vector to store the data
let mut v = ManuallyDrop::new(Vec::with_capacity(new_cap));

Expand Down

0 comments on commit 10ca02f

Please sign in to comment.