Skip to content

Commit a67fe9c

Browse files
authored
Do not look for Cargo.toml inside target (#15692)
This test, which checks that we do not define new profiles directly in Clippy's multiple `Cargo.toml` files, must not look inside `target` as `lintcheck` might place some third-party sources there. Of course those third-party sources are allowed to define profiles in their `Cargo.toml`. changelog: none
2 parents 7a5f0bd + e84b5ca commit a67fe9c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/no-profile-in-cargo-toml.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ fn no_profile_in_cargo_toml() {
1717
// keep it fast and simple.
1818
for entry in WalkDir::new(".")
1919
.into_iter()
20+
// Do not recurse into `target` as lintcheck might put some sources (and their
21+
// `Cargo.toml`) there.
22+
.filter_entry(|e| e.file_name() != "target")
2023
.filter_map(Result::ok)
2124
.filter(|e| e.file_name().to_str() == Some("Cargo.toml"))
2225
{

0 commit comments

Comments
 (0)