Fix build

This commit is contained in:
Eelco Dolstra 2022-05-12 22:49:54 +02:00
parent 212e28d945
commit a0ed002ba9
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 3 additions and 7 deletions

View file

@ -66,8 +66,10 @@ std::shared_ptr<Node> LockFile::findInput(const InputPath & path)
return pos;
}
LockFile::LockFile(const nlohmann::json & json, std::string_view path)
LockFile::LockFile(std::string_view contents, std::string_view path)
{
auto json = nlohmann::json::parse(contents);
auto version = json.value("version", 0);
if (version < 5 || version > 7)
throw Error("lock file '%s' has unsupported version %d", path, version);
@ -116,11 +118,6 @@ LockFile::LockFile(const nlohmann::json & json, std::string_view path)
// a bit since we don't need to worry about cycles.
}
LockFile::LockFile(std::string_view contents, std::string_view path)
: LockFile(nlohmann::json::parse(contents), path)
{
}
nlohmann::json LockFile::toJSON() const
{
nlohmann::json nodes;

View file

@ -50,7 +50,6 @@ struct LockFile
std::shared_ptr<Node> root = std::make_shared<Node>();
LockFile() {};
LockFile(const nlohmann::json & json, std::string_view path);
LockFile(std::string_view contents, std::string_view path);
nlohmann::json toJSON() const;