Skip to content

Commit

Permalink
refactor: Make relativeTo more copy-paste friendly
Browse files Browse the repository at this point in the history
We have a copy of this module in Dub which forwards to this function while wrapping
GenericPath and this special case hit us.
  • Loading branch information
Geod24 committed Dec 31, 2024
1 parent 20e3193 commit 3c21b02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/vibe/core/path.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Path relativeTo(Path)(in Path path, in Path base_path) @safe
assert(base_path.absolute, "Base path must be absolute for relativeTo.");
assert(path.absolute, "Path must be absolute for relativeTo.");

if (is(Path == WindowsPath)) { // FIXME: this shouldn't be a special case here!
if (is(Path.Format == WindowsPathFormat)) { // FIXME: this shouldn't be a special case here!
bool samePrefix(size_t n)
{
return path.bySegment.map!(n => n.encodedName).take(n).equal(base_path.bySegment.map!(n => n.encodedName).take(n));
Expand Down

0 comments on commit 3c21b02

Please sign in to comment.