Skip to content

Commit 4b102fd

Browse files
authored
Merge pull request #3628 from topecongiro/issue-3627
Fix is_subpath
2 parents dbac28b + a4eab17 commit 4b102fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ where
6666
P: AsRef<Path>,
6767
{
6868
(0..path.components().count())
69-
.map(|i| path.components().take(i))
69+
.map(|i| {
70+
path.components()
71+
.skip(i)
72+
.take(subpath.as_ref().components().count())
73+
})
7074
.any(|c| c.zip(subpath.as_ref().components()).all(|(a, b)| a == b))
7175
}
7276

0 commit comments

Comments
 (0)