@@ -49,13 +49,13 @@ impl PackageContentsTest {
49
49
}
50
50
51
51
/// Check a list of (glob, GlobSet) against paths, collecting any missing or forbidden matches
52
- fn check_globs (
52
+ fn check_globs < ' a > (
53
53
globs : & [ ( String , GlobSet ) ] ,
54
- paths : & [ & PathBuf ] ,
54
+ paths : & [ & ' a PathBuf ] ,
55
55
section : & str ,
56
56
expect_exists : bool ,
57
57
collected_issues : & mut Vec < String > ,
58
- matched_paths : & mut HashSet < & PathBuf > ,
58
+ matched_paths : & mut HashSet < & ' a PathBuf > ,
59
59
) {
60
60
for ( glob_str, globset) in globs {
61
61
let matches: Vec < & PathBuf > = paths
@@ -377,7 +377,14 @@ impl PackageContentsTest {
377
377
( "files" , self . files_as_globs( target_platform) ?) ,
378
378
] ;
379
379
for ( section, globs) in exists_sections {
380
- Self :: check_globs ( & globs, & paths, section, true , & mut collected_issues, & mut matched_paths) ;
380
+ Self :: check_globs (
381
+ & globs,
382
+ & paths,
383
+ section,
384
+ true ,
385
+ & mut collected_issues,
386
+ & mut matched_paths,
387
+ ) ;
381
388
}
382
389
383
390
// Check forbidden (not_exists) globs
@@ -395,7 +402,14 @@ impl PackageContentsTest {
395
402
( "files" , self . files_not_exists_as_globs( target_platform) ?) ,
396
403
] ;
397
404
for ( section, globs) in not_exists_sections {
398
- Self :: check_globs ( & globs, & paths, section, false , & mut collected_issues, & mut matched_paths) ;
405
+ Self :: check_globs (
406
+ & globs,
407
+ & paths,
408
+ section,
409
+ false ,
410
+ & mut collected_issues,
411
+ & mut matched_paths,
412
+ ) ;
399
413
}
400
414
401
415
// Check strict mode
@@ -443,7 +457,9 @@ impl PackageContentsTest {
443
457
collected_issues. push ( message. clone ( ) ) ;
444
458
}
445
459
446
- return Err ( TestError :: PackageContentTestFailed ( collected_issues. join ( "\n " ) ) ) ;
460
+ return Err ( TestError :: PackageContentTestFailed (
461
+ collected_issues. join ( "\n " ) ,
462
+ ) ) ;
447
463
}
448
464
449
465
Ok ( ( ) )
@@ -659,14 +675,14 @@ mod tests {
659
675
#[ test]
660
676
fn test_strict_mode ( ) {
661
677
let strict_contents = PackageContentsTest {
662
- files : GlobVec :: from_vec ( vec ! [ "matched.txt" ] , None ) ,
678
+ files : GlobCheckerVec :: from_vec ( vec ! [ "matched.txt" ] , None ) ,
663
679
strict : true ,
664
680
..Default :: default ( )
665
681
} ;
666
682
assert ! ( strict_contents. strict) ;
667
683
668
684
let non_strict_contents = PackageContentsTest {
669
- files : GlobVec :: from_vec ( vec ! [ "*.txt" ] , None ) ,
685
+ files : GlobCheckerVec :: from_vec ( vec ! [ "*.txt" ] , None ) ,
670
686
..Default :: default ( )
671
687
} ;
672
688
assert ! ( !non_strict_contents. strict) ;
0 commit comments