File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 9292 }
9393
9494 // Check for Content-Length.
95- match content_length {
96- Some ( len) => {
97- let len = len. last ( ) . unwrap ( ) . as_str ( ) . parse :: < usize > ( ) ?;
98- res. set_body ( Body :: from_reader ( reader. take ( len as u64 ) , Some ( len) ) ) ;
99- }
100- None => { }
95+ if let Some ( len) = content_length {
96+ let len = len. last ( ) . unwrap ( ) . as_str ( ) . parse :: < usize > ( ) ?;
97+ res. set_body ( Body :: from_reader ( reader. take ( len as u64 ) , Some ( len) ) ) ;
10198 }
10299
103100 // Return the response.
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ impl Read for Encoder {
115115 if !self . headers_done {
116116 let len = std:: cmp:: min ( self . headers . len ( ) - self . cursor , buf. len ( ) ) ;
117117 let range = self . cursor ..self . cursor + len;
118- buf[ 0 ..len] . copy_from_slice ( & mut self . headers [ range] ) ;
118+ buf[ 0 ..len] . copy_from_slice ( & self . headers [ range] ) ;
119119 self . cursor += len;
120120 if self . cursor == self . headers . len ( ) {
121121 self . headers_done = true ;
You can’t perform that action at this time.
0 commit comments