Merge pull request #165 from vibe-d/pure_parent_path

Make GenericPath.parentPath pure.
This commit is contained in:
Sönke Ludwig 2019-08-21 19:26:00 +02:00 committed by GitHub
commit a2f970b7b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -478,7 +478,7 @@ struct GenericPath(F) {
GenericPath parentPath()
const @nogc {
auto b = Format.getBackNode(m_path);
static const Exception e = new Exception("Path has no parent path");
static immutable Exception e = new Exception("Path has no parent path");
if (b.length >= m_path.length) throw e;
return GenericPath.fromTrustedString(m_path[0 .. $ - b.length]);
}