File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
quic/s2n-quic-core/src/buffer/reader/storage Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ impl Storage for BytesMut {
4747 {
4848 let watermark = self . len ( ) . min ( dest. remaining_capacity ( ) ) ;
4949
50- if Dest :: SPECIALIZES_BYTES_MUT {
50+ let consumes_self = watermark == self . len ( ) ;
51+
52+ if Dest :: SPECIALIZES_BYTES_MUT || consumes_self {
5153 let Chunk :: BytesMut ( chunk) = self . infallible_read_chunk ( watermark) else {
5254 unsafe { assume ! ( false ) }
5355 } ;
@@ -97,7 +99,9 @@ impl Storage for Bytes {
9799 {
98100 let watermark = self . len ( ) . min ( dest. remaining_capacity ( ) ) ;
99101
100- if Dest :: SPECIALIZES_BYTES {
102+ let consumes_self = watermark == self . len ( ) ;
103+
104+ if Dest :: SPECIALIZES_BYTES || consumes_self {
101105 let Chunk :: Bytes ( chunk) = self . infallible_read_chunk ( watermark) else {
102106 unsafe { assume ! ( false ) }
103107 } ;
You can’t perform that action at this time.
0 commit comments