mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Guarantee address in slice() for empty slices. (#780)
This commit is contained in:
+1
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user