Skip to content

Commit

Permalink
remove unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
LaihoE committed Aug 22, 2024
1 parent dbd973c commit 6095435
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/parser/src/parse_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ impl<'a> Parser<'a> {
return thread::scope(|s| {
let _handle = s.spawn(|| fp.par_start(demo_bytes, sender));
let mut first_pass_parser = FirstPassParser::new(&self.input);
let first_pass_output = first_pass_parser.parse_demo(&demo_bytes, true).unwrap();
let out = self.second_pass_threaded_with_channels(demo_bytes, first_pass_output, receiver);
out
match first_pass_parser.parse_demo(&demo_bytes, true) {
Ok(first_pass_output) => self.second_pass_threaded_with_channels(demo_bytes, first_pass_output, receiver),
Err(e) => Err(e),
}
});
}
// Single threaded second pass
Expand Down Expand Up @@ -130,7 +131,7 @@ impl<'a> Parser<'a> {
// Fallback if channels failed to find all fullpackets. Should be rare.
if !channel_threading_was_ok {
let mut first_pass_parser = FirstPassParser::new(&self.input);
let first_pass_output = first_pass_parser.parse_demo(outer_bytes, false).unwrap();
let first_pass_output = first_pass_parser.parse_demo(outer_bytes, false)?;
return self.second_pass_multi_threaded_no_channels(outer_bytes, first_pass_output);
}
// check for errors
Expand Down

0 comments on commit 6095435

Please # to comment.