We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 68f26dc + f2f3c55 commit c29175fCopy full SHA for c29175f
xtask/tests/tidy.rs
@@ -180,13 +180,11 @@ impl TidyDocs {
180
}
181
182
fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool {
183
- let mut cur_path = p;
184
- while let Some(path) = cur_path.parent() {
185
- if dirs_to_exclude.iter().any(|dir| path.ends_with(dir)) {
186
- return true;
187
- }
188
- cur_path = path;
189
190
-
191
- false
+ p.strip_prefix(project_root())
+ .unwrap()
+ .components()
+ .rev()
+ .skip(1)
+ .filter_map(|it| it.as_os_str().to_str())
+ .any(|it| dirs_to_exclude.contains(&it))
192
0 commit comments