Make intToString -> readString more generic

Make readString work with any char range and unsigned integral type.
This commit is contained in:
2018-06-05 20:23:39 +02:00
parent c663703221
commit 7561b964d3
2 changed files with 89 additions and 14 deletions

View File

@ -305,7 +305,8 @@ struct URL
*/
private bool parsePort(const(char)[] port) @nogc nothrow pure @safe
{
return stringToInt(port[1 .. $], this.port);
auto portNumber = port[1 .. $];
return readString(portNumber, this.port) || portNumber[0] == '/';
}
}