diff --git a/src/test/mod.rs b/src/test/mod.rs index 2830f9aeff1c..5ac0a1d44509 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -66,7 +66,11 @@ where P: AsRef, { (0..path.components().count()) - .map(|i| path.components().take(i)) + .map(|i| { + path.components() + .skip(i) + .take(subpath.as_ref().components().count()) + }) .any(|c| c.zip(subpath.as_ref().components()).all(|(a, b)| a == b)) }