mirror of https://github.com/adamdruppe/arsd.git
string was too restrictive, const char good enough
This commit is contained in:
parent
aef7177402
commit
b5c718f7ed
4
jsvar.d
4
jsvar.d
|
@ -1542,13 +1542,13 @@ struct var {
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
static var fromJson(string json) {
|
static var fromJson(const(char)[] json) {
|
||||||
auto decoded = parseJSON(json);
|
auto decoded = parseJSON(json);
|
||||||
return var.fromJsonValue(decoded);
|
return var.fromJsonValue(decoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
static var fromJsonFile(string filename) {
|
static var fromJsonFile(const(char)[] filename) {
|
||||||
import std.file;
|
import std.file;
|
||||||
return var.fromJson(readText(filename));
|
return var.fromJson(readText(filename));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue