cargo fmt

This commit is contained in:
Ami Fischman
2026-01-13 16:37:11 -08:00
parent 1993c76971
commit 1df183e0cd
3 changed files with 17 additions and 7 deletions
+1 -4
View File
@@ -529,10 +529,7 @@ pub struct Opts {
pub hyperlink: HyperlinkWhen,
/// Ignore directories containing the named entry.
#[arg(
long,
value_name = "name"
)]
#[arg(long, value_name = "name")]
pub ignore_contain: Vec<String>,
/// Set number of threads to use for searching & executing (default: number
+4 -1
View File
@@ -503,7 +503,10 @@ impl WorkerState {
// Filter out directories containing a given name.
if entry_path.is_dir()
&& config.ignore_contain.iter().any(|ic| entry_path.join(ic).exists())
&& config
.ignore_contain
.iter()
.any(|ic| entry_path.join(ic).exists())
{
return WalkState::Skip;
}
+12 -2
View File
@@ -2724,7 +2724,14 @@ fn test_ignore_contain() {
include/foo
symlink
top";
te.assert_output(&["--ignore-contain=CACHEDIR.TAG", "--ignore-contain=ignoremyparent", "."], expected);
te.assert_output(
&[
"--ignore-contain=CACHEDIR.TAG",
"--ignore-contain=ignoremyparent",
".",
],
expected,
);
}
#[test]
@@ -2739,5 +2746,8 @@ fn test_ignore_contain_has_highest_precedence() {
],
);
let expected = "include/foo";
te.assert_output(&["--ignore-contain=CACHEDIR.TAG", "--min-depth=2", "."], expected);
te.assert_output(
&["--ignore-contain=CACHEDIR.TAG", "--min-depth=2", "."],
expected,
);
}