diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs index f3ad42e80..5aaf2958d 100644 --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -392,10 +392,8 @@ impl BytesMut { unsafe { let mut other = self.shallow_clone(); - assert!(at <= other.cap, "set_end out of bounds"); - other.cap = at; - other.len = cmp::min(other.len, at); + other.len = at; self.set_start(at); other }