@@ -374,11 +374,12 @@ fn parse_and_test_file(
374
374
mut config : Config ,
375
375
file_contents : Vec < u8 > ,
376
376
) -> Result < Vec < TestRun > , Errored > {
377
- let comments = parse_comments (
377
+ let comments = Comments :: parse (
378
378
& file_contents,
379
379
config. comment_defaults . clone ( ) ,
380
380
status. path ( ) ,
381
- ) ?;
381
+ )
382
+ . map_err ( |errors| Errored :: new ( errors, "parse comments" ) ) ?;
382
383
const EMPTY : & [ String ] = & [ String :: new ( ) ] ;
383
384
// Run the test for all revisions
384
385
let revisions = comments. revisions . as_deref ( ) . unwrap_or ( EMPTY ) ;
@@ -416,22 +417,6 @@ fn parse_and_test_file(
416
417
. collect ( ) )
417
418
}
418
419
419
- fn parse_comments (
420
- file_contents : & [ u8 ] ,
421
- comments : Comments ,
422
- file : & Path ,
423
- ) -> Result < Comments , Errored > {
424
- match Comments :: parse ( file_contents, comments, file) {
425
- Ok ( comments) => Ok ( comments) ,
426
- Err ( errors) => Err ( Errored {
427
- command : Command :: new ( "parse comments" ) ,
428
- errors,
429
- stderr : vec ! [ ] ,
430
- stdout : vec ! [ ] ,
431
- } ) ,
432
- }
433
- }
434
-
435
420
fn build_command (
436
421
path : & Path ,
437
422
config : & Config ,
@@ -488,7 +473,8 @@ fn build_aux(
488
473
stderr : err. to_string ( ) . into_bytes ( ) ,
489
474
stdout : vec ! [ ] ,
490
475
} ) ?;
491
- let comments = parse_comments ( & file_contents, config. comment_defaults . clone ( ) , aux_file) ?;
476
+ let comments = Comments :: parse ( & file_contents, config. comment_defaults . clone ( ) , aux_file)
477
+ . map_err ( |errors| Errored :: new ( errors, "parse aux comments" ) ) ?;
492
478
assert_eq ! (
493
479
comments. revisions, None ,
494
480
"aux builds cannot specify revisions"
0 commit comments