Skip to content

Commit

Permalink
Merge pull request #3628 from topecongiro/issue-3627
Browse files Browse the repository at this point in the history
Fix is_subpath
  • Loading branch information
scampi committed Jun 14, 2019
2 parents dbac28b + a4eab17 commit 4b102fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 4b102fd

Please sign in to comment.