string was too restrictive, const char good enough

This commit is contained in:
Adam D. Ruppe 2021-12-22 18:48:36 -05:00
parent aef7177402
commit b5c718f7ed
1 changed files with 2 additions and 2 deletions

View File

@ -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));
} }