Fix is_subpath
This commit is contained in:
parent
dbac28b4b4
commit
a4eab17d7c
1 changed files with 5 additions and 1 deletions
|
|
@ -66,7 +66,11 @@ where
|
|||
P: AsRef<Path>,
|
||||
{
|
||||
(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))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue