Skip to content

Commit 6095435

Browse files
committed
remove unwrap
1 parent dbd973c commit 6095435

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/parser/src/parse_demo.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ impl<'a> Parser<'a> {
6969
return thread::scope(|s| {
7070
let _handle = s.spawn(|| fp.par_start(demo_bytes, sender));
7171
let mut first_pass_parser = FirstPassParser::new(&self.input);
72-
let first_pass_output = first_pass_parser.parse_demo(&demo_bytes, true).unwrap();
73-
let out = self.second_pass_threaded_with_channels(demo_bytes, first_pass_output, receiver);
74-
out
72+
match first_pass_parser.parse_demo(&demo_bytes, true) {
73+
Ok(first_pass_output) => self.second_pass_threaded_with_channels(demo_bytes, first_pass_output, receiver),
74+
Err(e) => Err(e),
75+
}
7576
});
7677
}
7778
// Single threaded second pass
@@ -130,7 +131,7 @@ impl<'a> Parser<'a> {
130131
// Fallback if channels failed to find all fullpackets. Should be rare.
131132
if !channel_threading_was_ok {
132133
let mut first_pass_parser = FirstPassParser::new(&self.input);
133-
let first_pass_output = first_pass_parser.parse_demo(outer_bytes, false).unwrap();
134+
let first_pass_output = first_pass_parser.parse_demo(outer_bytes, false)?;
134135
return self.second_pass_multi_threaded_no_channels(outer_bytes, first_pass_output);
135136
}
136137
// check for errors

0 commit comments

Comments
 (0)