Improved code formatting

This commit is contained in:
Harry T. Vennik 2017-11-04 10:59:41 +01:00
parent 92447921a7
commit 34e42b9aa2

View file

@ -27,7 +27,9 @@ struct ObjectPath {
return _value; return _value;
} }
/// Returns the string representation of this ObjectPath. /++
Returns the string representation of this ObjectPath.
+/
string value() const pure @nogc nothrow @safe { string value() const pure @nogc nothrow @safe {
return _value; return _value;
} }
@ -71,7 +73,10 @@ struct ObjectPath {
_value = opBinary!"~"(rhs)._value; _value = opBinary!"~"(rhs)._value;
} }
/// Returns: false for empty strings or strings that don't match the pattern `(/[0-9A-Za-z_]+)+|/` /++
Returns: `false` for empty strings or strings that don't match the
pattern `(/[0-9A-Za-z_]+)+|/`.
+/
static bool isValid(string objPath) pure @nogc nothrow @safe { static bool isValid(string objPath) pure @nogc nothrow @safe {
import std.ascii : isAlphaNum; import std.ascii : isAlphaNum;
@ -83,12 +88,12 @@ struct ObjectPath {
return false; return false;
// .representation to avoid unicode exceptions -> @nogc & nothrow // .representation to avoid unicode exceptions -> @nogc & nothrow
return objPath.representation.splitter('/').drop(1) return objPath.representation.splitter('/').drop(1)
.all!(a => .all!(a =>
a.length && a.length &&
a.all!(c => a.all!(c =>
c.isAlphaNum || c == '_' c.isAlphaNum || c == '_'
) )
); );
} }
} }