Skip to content

Commit 6c6e3c3

Browse files
authored
Parse payload before potentially skipping (#63)
If the rank is different, we try to skip the row in the tlparse, but we need to consume the attached payload first, or else the payload will fail to parse as a new line.
1 parent 447b11a commit 6c6e3c3

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -291,21 +291,6 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result<ParseOu
291291
continue;
292292
};
293293

294-
match expected_rank {
295-
Some(rank) => {
296-
if rank != e.rank {
297-
stats.other_rank += 1;
298-
continue;
299-
}
300-
}
301-
None => {
302-
multi.suspend(|| {
303-
eprintln!("Detected rank: {:?}", e.rank);
304-
});
305-
expected_rank = Some(e.rank);
306-
}
307-
};
308-
309294
let mut payload = String::new();
310295
if let Some(ref expect) = e.has_payload {
311296
let mut first = true;
@@ -333,6 +318,21 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result<ParseOu
333318
}
334319
}
335320

321+
match expected_rank {
322+
Some(rank) => {
323+
if rank != e.rank {
324+
stats.other_rank += 1;
325+
continue;
326+
}
327+
}
328+
None => {
329+
multi.suspend(|| {
330+
eprintln!("Detected rank: {:?}", e.rank);
331+
});
332+
expected_rank = Some(e.rank);
333+
}
334+
};
335+
336336
stats.ok += 1;
337337

338338
// lol this clone, probably shouldn't use entry

0 commit comments

Comments
 (0)