File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ pub fn load_error(text_file: &str, stderr_file: Option<&str>) -> Vec<Error> {
123
123
return errors;
124
124
}
125
125
// TODO: improve this code incrementally
126
- let error_code_stderr = parse_error_code ( stderr_file. unwrap ( ) ) ;
126
+ let error_code_stderr = parse_error_code ( stderr_file. expect ( "stderr file is not found" ) ) ;
127
127
128
128
for error in errors. iter_mut ( ) {
129
129
for error_code in error_code_stderr. iter ( ) {
@@ -178,7 +178,9 @@ fn parse_error_code(stderr_content: &str) -> Vec<StderrResult> {
178
178
results. push ( StderrResult {
179
179
error_code,
180
180
error_message_detail,
181
- line_number : line_number. parse :: < usize > ( ) . unwrap ( ) ,
181
+ line_number : line_number
182
+ . parse :: < usize > ( )
183
+ . expect ( "expected line number to be a valid number" ) ,
182
184
} ) ;
183
185
}
184
186
@@ -207,7 +209,9 @@ fn parse_expected(
207
209
} ;
208
210
209
211
// Get the part of the comment after the sigil (e.g. `~^^` or ~|).
210
- let whole_match = captures. get ( 0 ) . unwrap ( ) ;
212
+ let whole_match = captures
213
+ . get ( 0 )
214
+ . expect ( "Failed to parse comments like \" //~\" \" //~^\" \" //~^^^^^\" " ) ;
211
215
let ( _, mut msg) = line. split_at ( whole_match. end ( ) ) ;
212
216
213
217
let first_word = msg
You can’t perform that action at this time.
0 commit comments