From 24f4e5f70f9a7b4bf0c4ad957cbb9473bd47f6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Thu, 10 Aug 2017 10:09:01 +0200 Subject: [PATCH] Resurrect GenericPath.startsWith. Since the semantics are different w.r.t. path separators, the alternative suggested in the deprecation message is not valid. At least until the comparison/toString semantics of PathSegment have a profound definition, it will be kept around to avoid unneeded interruptions when upgrading to 0.8.x. --- source/vibe/core/path.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/vibe/core/path.d b/source/vibe/core/path.d index 27d0085..937e261 100644 --- a/source/vibe/core/path.d +++ b/source/vibe/core/path.d @@ -597,9 +597,12 @@ struct GenericPath(F) { /// Appends a relative path to this path. void opOpAssign(string op : "~", T)(T op) { this = this ~ op; } - deprecated("Use .bySegment together with std.algorithm.searching.startsWith instead.") + /** Tests whether the given path is a prefix of this path. + + Any path separators will be ignored during the comparison. + */ bool startsWith(GenericPath prefix) - { + const nothrow { return bySegment.map!(n => n.name).startsWith(prefix.bySegment.map!(n => n.name)); } }