From 2bc6d309c00161b2315b9f98645810699fff3126 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 1 Aug 2024 17:44:23 +0200 Subject: Use HashFunction::Type to deserialize ArtifactDescription --- src/buildtool/common/tree.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/buildtool/common/tree.hpp') diff --git a/src/buildtool/common/tree.hpp b/src/buildtool/common/tree.hpp index 53333901..55922346 100644 --- a/src/buildtool/common/tree.hpp +++ b/src/buildtool/common/tree.hpp @@ -54,13 +54,15 @@ class Tree { return ArtifactDescription::CreateTree(id_); } - [[nodiscard]] static auto FromJson(std::string const& id, + [[nodiscard]] static auto FromJson(HashFunction::Type hash_type, + std::string const& id, nlohmann::json const& json) -> std::optional { auto inputs = inputs_t{}; inputs.reserve(json.size()); for (auto const& [path, artifact] : json.items()) { - auto artifact_desc = ArtifactDescription::FromJson(artifact); + auto artifact_desc = + ArtifactDescription::FromJson(hash_type, artifact); if (not artifact_desc) { return std::nullopt; } -- cgit v1.2.3