File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ include = [
20
20
]
21
21
22
22
[dependencies ]
23
- bytes = " 1"
23
+ bytes = " 1.2 "
24
24
http = " 1"
25
25
http-body = " 1"
26
26
tokio = { version = " 1" , features = [" sync" ] }
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ use std::fmt;
3
3
#[ cfg( feature = "server" ) ]
4
4
use std:: future:: Future ;
5
5
use std:: io:: { self , IoSlice } ;
6
- use std:: mem:: MaybeUninit ;
7
6
use std:: pin:: Pin ;
8
7
use std:: task:: { Context , Poll } ;
9
8
@@ -246,8 +245,9 @@ where
246
245
self . read_buf . reserve ( next) ;
247
246
}
248
247
249
- let dst = self . read_buf . chunk_mut ( ) ;
250
- let dst = unsafe { & mut * ( dst as * mut _ as * mut [ MaybeUninit < u8 > ] ) } ;
248
+ // SAFETY: ReadBuf and poll_read promise not to set any uninitialized
249
+ // bytes onto `dst`.
250
+ let dst = unsafe { self . read_buf . chunk_mut ( ) . as_uninit_slice_mut ( ) } ;
251
251
let mut buf = ReadBuf :: uninit ( dst) ;
252
252
match Pin :: new ( & mut self . io ) . poll_read ( cx, buf. unfilled ( ) ) {
253
253
Poll :: Ready ( Ok ( _) ) => {
You can’t perform that action at this time.
0 commit comments