aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/remote-fs-accessor.cc
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2022-11-16 16:49:49 +0100
committerYorick van Pelt <yorick@yorickvanpelt.nl>2022-11-16 16:50:50 +0100
commit09f00dd4d01aa1b6866978d162022133e521614f (patch)
tree1d7470dfc9d7bb997d684294e0048280079a11a2 /src/libstore/remote-fs-accessor.cc
parent62960f32915909a5104f2ca3a32b25fb3cfd34c7 (diff)
Replace src/libutil/json.cc with nlohmann json generation
Diffstat (limited to 'src/libstore/remote-fs-accessor.cc')
-rw-r--r--src/libstore/remote-fs-accessor.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstore/remote-fs-accessor.cc b/src/libstore/remote-fs-accessor.cc
index 0ce335646..fcfb527f5 100644
--- a/src/libstore/remote-fs-accessor.cc
+++ b/src/libstore/remote-fs-accessor.cc
@@ -1,6 +1,6 @@
+#include <nlohmann/json.hpp>
#include "remote-fs-accessor.hh"
#include "nar-accessor.hh"
-#include "json.hh"
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,10 +38,8 @@ ref<FSAccessor> RemoteFSAccessor::addToCache(std::string_view hashPart, std::str
if (cacheDir != "") {
try {
- std::ostringstream str;
- JSONPlaceholder jsonRoot(str);
- listNar(jsonRoot, narAccessor, "", true);
- writeFile(makeCacheFile(hashPart, "ls"), str.str());
+ nlohmann::json j = listNar(narAccessor, "", true);
+ writeFile(makeCacheFile(hashPart, "ls"), j.dump());
} catch (...) {
ignoreException();
}