Skip to content

Commit

Permalink
consistency in split_off and split_to
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar committed Feb 6, 2024
1 parent 037dbe1 commit b971743
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 @@ -393,11 +393,11 @@ impl BytesMut {

unsafe {
let mut other = self.shallow_clone();
other.cap = at;
other.len = at;
// SAFETY: We've checked that `at` <= `self.len()` and we know that `self.len()` <=
// `self.capacity()`.
self.advance_unchecked(at);
other.cap = at;
other.len = at;
other
}
}
Expand Down

0 comments on commit b971743

Please sign in to comment.