diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-01 17:44:23 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-11 14:52:07 +0200 |
commit | 2bc6d309c00161b2315b9f98645810699fff3126 (patch) | |
tree | 8185d375463e79b39485448920fa68cca2a206a2 /src/buildtool/common/tree.hpp | |
parent | abae1d3c8032fec872bda44de7f7d754654cf201 (diff) | |
download | justbuild-2bc6d309c00161b2315b9f98645810699fff3126.tar.gz |
Use HashFunction::Type to deserialize ArtifactDescription
Diffstat (limited to 'src/buildtool/common/tree.hpp')
-rw-r--r-- | src/buildtool/common/tree.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<Tree::Ptr> { 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; } |