File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -281,18 +281,15 @@ impl EventParser {
281281 // incomplete lines from previous chunks.
282282 fn decode_and_buffer_lines ( & mut self , chunk : Bytes ) {
283283 let mut lines = chunk. split_inclusive ( |& b| b == b'\n' || b == b'\r' ) ;
284-
285284 // The first and last elements in this split are special. The spec requires lines to be
286285 // terminated. But lines may span chunks, so:
287286 // * the last line, if non-empty (i.e. if chunk didn't end with a line terminator),
288287 // should be buffered as an incomplete line
289288 // * the first line should be appended to the incomplete line, if any
290289
291290 if let Some ( incomplete_line) = self . incomplete_line . as_mut ( ) {
292- let line = lines
293- . next ( )
294- // split always returns at least one item
295- . unwrap ( ) ;
291+ let line = lines. next ( ) . expect ( "Should not be none!" ) ;
292+ // split always returns at least one item
296293 trace ! (
297294 "extending line from previous chunk: {:?}+{:?}" ,
298295 logify( incomplete_line) ,
You can’t perform that action at this time.
0 commit comments