File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ include = [
2020]
2121
2222[dependencies ]
23- bytes = " 1"
23+ bytes = " 1.2 "
2424http = " 1"
2525http-body = " 1"
2626tokio = { version = " 1" , features = [" sync" ] }
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ use std::fmt;
33#[ cfg( feature = "server" ) ]
44use std:: future:: Future ;
55use std:: io:: { self , IoSlice } ;
6- use std:: mem:: MaybeUninit ;
76use std:: pin:: Pin ;
87use std:: task:: { Context , Poll } ;
98
@@ -246,8 +245,9 @@ where
246245 self . read_buf . reserve ( next) ;
247246 }
248247
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 ( ) } ;
251251 let mut buf = ReadBuf :: uninit ( dst) ;
252252 match Pin :: new ( & mut self . io ) . poll_read ( cx, buf. unfilled ( ) ) {
253253 Poll :: Ready ( Ok ( _) ) => {
You can’t perform that action at this time.
0 commit comments