Clean up std.json deprecation

This commit is contained in:
Geod24 2019-08-20 17:56:26 +09:00
parent a88f9f92af
commit e7294bb9bd

View file

@ -301,7 +301,13 @@ private void init()
private T fromValue(T)(in JSONValue val) private T fromValue(T)(in JSONValue val)
{ {
import std.conv : to; import std.conv : to;
static if (is(T == bool)) return val.type == JSON_TYPE.TRUE; static if (is(T == bool)) {
// JSONType.TRUE has been deprecated in v2.087.0
static if (is(typeof(JSONType.true_)))
return val.type == JSONType.true_;
else
return val.type == JSONType.TRUE;
}
else static if (is(T : long)) return val.integer.to!T; else static if (is(T : long)) return val.integer.to!T;
else static if (is(T : double)) return val.floating.to!T; else static if (is(T : double)) return val.floating.to!T;
else static if (is(T == string)) return val.str; else static if (is(T == string)) return val.str;