Skip to content

Commit e727289

Browse files
committed
linter afte rmerge
1 parent 8078e24 commit e727289

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

src/package_test/content_test.rs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ impl PackageContentsTest {
4949
}
5050

5151
/// Check a list of (glob, GlobSet) against paths, collecting any missing or forbidden matches
52-
fn check_globs(
52+
fn check_globs<'a>(
5353
globs: &[(String, GlobSet)],
54-
paths: &[&PathBuf],
54+
paths: &[&'a PathBuf],
5555
section: &str,
5656
expect_exists: bool,
5757
collected_issues: &mut Vec<String>,
58-
matched_paths: &mut HashSet<&PathBuf>,
58+
matched_paths: &mut HashSet<&'a PathBuf>,
5959
) {
6060
for (glob_str, globset) in globs {
6161
let matches: Vec<&PathBuf> = paths
@@ -377,7 +377,14 @@ impl PackageContentsTest {
377377
("files", self.files_as_globs(target_platform)?),
378378
];
379379
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+
);
381388
}
382389

383390
// Check forbidden (not_exists) globs
@@ -395,7 +402,14 @@ impl PackageContentsTest {
395402
("files", self.files_not_exists_as_globs(target_platform)?),
396403
];
397404
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+
);
399413
}
400414

401415
// Check strict mode
@@ -443,7 +457,9 @@ impl PackageContentsTest {
443457
collected_issues.push(message.clone());
444458
}
445459

446-
return Err(TestError::PackageContentTestFailed(collected_issues.join("\n")));
460+
return Err(TestError::PackageContentTestFailed(
461+
collected_issues.join("\n"),
462+
));
447463
}
448464

449465
Ok(())
@@ -659,14 +675,14 @@ mod tests {
659675
#[test]
660676
fn test_strict_mode() {
661677
let strict_contents = PackageContentsTest {
662-
files: GlobVec::from_vec(vec!["matched.txt"], None),
678+
files: GlobCheckerVec::from_vec(vec!["matched.txt"], None),
663679
strict: true,
664680
..Default::default()
665681
};
666682
assert!(strict_contents.strict);
667683

668684
let non_strict_contents = PackageContentsTest {
669-
files: GlobVec::from_vec(vec!["*.txt"], None),
685+
files: GlobCheckerVec::from_vec(vec!["*.txt"], None),
670686
..Default::default()
671687
};
672688
assert!(!non_strict_contents.strict);

src/recipe/parser/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,16 +709,16 @@ mod test {
709709
match &tests[0] {
710710
TestType::PackageContents { package_contents } => {
711711
assert!(package_contents.strict);
712-
assert_eq!(package_contents.files.include_globs().len(), 1);
713-
assert_eq!(package_contents.bin.include_globs().len(), 1);
712+
assert_eq!(package_contents.files.exists_globs().len(), 1);
713+
assert_eq!(package_contents.bin.exists_globs().len(), 1);
714714
}
715715
_ => panic!("expected package contents test"),
716716
}
717717

718718
match &tests[1] {
719719
TestType::PackageContents { package_contents } => {
720720
assert!(!package_contents.strict);
721-
assert_eq!(package_contents.files.include_globs().len(), 1);
721+
assert_eq!(package_contents.files.exists_globs().len(), 1);
722722
}
723723
_ => panic!("expected package contents test"),
724724
}

0 commit comments

Comments
 (0)