summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2023-11-08 17:38:00 +0100
committerAlberto Sartori <alberto.sartori@huawei.com>2023-11-15 20:19:18 +0100
commit3930fa41a1f43e90e2663d0ba40691647655ec6c (patch)
treee3a0b4fce8068fcc0d45e2d6873e52b04e874ab5 /src
parentf81bf5601b29e447613d8d365ca7cf55fab1b6c7 (diff)
downloadjustbuild-3930fa41a1f43e90e2663d0ba40691647655ec6c.tar.gz
artifact.hpp: make ToJson and FromJson consistent
The function ToJson used `file_type` key to express the type of the artifact, on the other hand, FromJson was expecting `type`. This patch makes the two functions consistent, prefering `file_type` for historical reasons.
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/common/artifact.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildtool/common/artifact.hpp b/src/buildtool/common/artifact.hpp
index 3a593f5b..76bb1c9f 100644
--- a/src/buildtool/common/artifact.hpp
+++ b/src/buildtool/common/artifact.hpp
@@ -98,9 +98,9 @@ class Artifact {
[[nodiscard]] static auto FromJson(nlohmann::json const& j)
-> std::optional<ObjectInfo> {
if (j.is_object() and j["id"].is_string() and
- j["size"].is_number() and j["type"].is_string()) {
+ j["size"].is_number() and j["file_type"].is_string()) {
auto const& object_type =
- FromChar(*(j["type"].get<std::string>().c_str()));
+ FromChar(*(j["file_type"].get<std::string>().c_str()));
return ObjectInfo{
.digest = ArtifactDigest{j["id"].get<std::string>(),
j["size"].get<std::size_t>(),