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 {
281
281
// incomplete lines from previous chunks.
282
282
fn decode_and_buffer_lines ( & mut self , chunk : Bytes ) {
283
283
let mut lines = chunk. split_inclusive ( |& b| b == b'\n' || b == b'\r' ) ;
284
-
285
284
// The first and last elements in this split are special. The spec requires lines to be
286
285
// terminated. But lines may span chunks, so:
287
286
// * the last line, if non-empty (i.e. if chunk didn't end with a line terminator),
288
287
// should be buffered as an incomplete line
289
288
// * the first line should be appended to the incomplete line, if any
290
289
291
290
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
296
293
trace ! (
297
294
"extending line from previous chunk: {:?}+{:?}" ,
298
295
logify( incomplete_line) ,
You can’t perform that action at this time.
0 commit comments