mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-08 00:00:26 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc4fb3e8f4 | ||
|
|
f488be48d0 |
@@ -1,3 +1,11 @@
|
||||
# 1.7.1 (August 1, 2024)
|
||||
|
||||
This release reverts the following change due to a regression:
|
||||
|
||||
- Reuse capacity when possible in `<BytesMut as Buf>::advance` impl (#698)
|
||||
|
||||
The revert can be found at #726.
|
||||
|
||||
# 1.7.0 (July 31, 2024)
|
||||
|
||||
### Added
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ name = "bytes"
|
||||
# When releasing to crates.io:
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v1.x.y" git tag.
|
||||
version = "1.7.0"
|
||||
version = "1.7.1"
|
||||
edition = "2018"
|
||||
rust-version = "1.39"
|
||||
license = "MIT"
|
||||
|
||||
@@ -1148,13 +1148,6 @@ impl Buf for BytesMut {
|
||||
|
||||
#[inline]
|
||||
fn advance(&mut self, cnt: usize) {
|
||||
// Advancing by the length is the same as resetting the length to 0,
|
||||
// except this way we get to reuse the full capacity.
|
||||
if cnt == self.remaining() {
|
||||
self.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
assert!(
|
||||
cnt <= self.remaining(),
|
||||
"cannot advance past `remaining`: {:?} <= {:?}",
|
||||
|
||||
Reference in New Issue
Block a user