Guarantee address in slice() for empty slices. (#780)

This commit is contained in:
Michael Färber
2025-05-20 14:52:05 +02:00
committed by GitHub
parent 5c90b11415
commit d9d5c59ef8
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -401,7 +401,7 @@ impl Bytes {
);
if end == begin {
return Bytes::new();
return Bytes::new_empty_with_ptr(self.ptr.wrapping_add(begin));
}
let mut ret = self.clone();