Merge pull request #5943 from NixOS/3204-fix-build-with-newer-nlohmann-json

Fix the build with nlohmann/json 3.10.4+
This commit is contained in:
Eelco Dolstra 2022-01-21 11:31:39 +01:00 committed by GitHub
commit accfcfff6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,7 +78,7 @@ Realisation Realisation::fromJSON(
auto fieldIterator = json.find(fieldName);
if (fieldIterator == json.end())
return std::nullopt;
return *fieldIterator;
return {*fieldIterator};
};
auto getField = [&](std::string fieldName) -> std::string {
if (auto field = getOptionalField(fieldName))