File tree 2 files changed +4
-7
lines changed 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 92
92
}
93
93
94
94
// 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) ) ) ;
101
98
}
102
99
103
100
// Return the response.
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ impl Read for Encoder {
115
115
if !self . headers_done {
116
116
let len = std:: cmp:: min ( self . headers . len ( ) - self . cursor , buf. len ( ) ) ;
117
117
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] ) ;
119
119
self . cursor += len;
120
120
if self . cursor == self . headers . len ( ) {
121
121
self . headers_done = true ;
You can’t perform that action at this time.
0 commit comments