aboutsummaryrefslogtreecommitdiff
path: root/xtask/tests/tidy.rs
diff options
context:
space:
mode:
authorveetaha <[email protected]>2020-06-02 21:15:23 +0100
committerveetaha <[email protected]>2020-06-02 21:15:23 +0100
commitf2f3c554af2c4a698e0ceb087ceb4dfa6f95ee90 (patch)
treec86120f59628ef38298efd7ac0293568ff1e1a2b /xtask/tests/tidy.rs
parentfb971c3bce710df234feb313528da81ccd5e26f9 (diff)
Don't exclude dirs that appear in project root parent path
Diffstat (limited to 'xtask/tests/tidy.rs')
-rw-r--r--xtask/tests/tidy.rs16
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
182fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { 182fn 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}