diff options
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/tests/tidy.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 4ac5d929f..62626064e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -180,13 +180,11 @@ impl TidyDocs { | |||
180 | } | 180 | } |
181 | 181 | ||
182 | fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { | 182 | fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { |
183 | let mut cur_path = p; | 183 | p.strip_prefix(project_root()) |
184 | while let Some(path) = cur_path.parent() { | 184 | .unwrap() |
185 | if dirs_to_exclude.iter().any(|dir| path.ends_with(dir)) { | 185 | .components() |
186 | return true; | 186 | .rev() |
187 | } | 187 | .skip(1) |
188 | cur_path = path; | 188 | .filter_map(|it| it.as_os_str().to_str()) |
189 | } | 189 | .any(|it| dirs_to_exclude.contains(&it)) |
190 | |||
191 | false | ||
192 | } | 190 | } |