aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-08-06 18:04:13 -0400
committerCarlo Nucera <carlo.nucera@protonmail.com>2020-08-06 18:04:13 -0400
commit9ab07e99f527d1fa3adfa02839da477a1528d64b (patch)
treebe1dd8e0671452ac4d62d5c7c13bbcb761fe0f52 /src/nix-store
parent3d8240c32eedd0809450be52e4ac7625ffdad9aa (diff)
Use template structs instead of phantoms
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index a0007f1c4..e59009d11 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -815,7 +815,7 @@ static void opServe(Strings opFlags, Strings opArgs)
case cmdQueryValidPaths: {
bool lock = readInt(in);
bool substitute = readInt(in);
- auto paths = nix::worker_proto::read(*store, in, Phantom<StorePathSet> {});
+ auto paths = WorkerProto<StorePathSet>::read(*store, in);
if (lock && writeAllowed)
for (auto & path : paths)
store->addTempRoot(path);
@@ -845,19 +845,19 @@ static void opServe(Strings opFlags, Strings opArgs)
}
}
- nix::worker_proto::write(*store, out, store->queryValidPaths(paths));
+ WorkerProto<StorePathSet>::write(*store, out, store->queryValidPaths(paths));
break;
}
case cmdQueryPathInfos: {
- auto paths = nix::worker_proto::read(*store, in, Phantom<StorePathSet> {});
+ auto paths = WorkerProto<StorePathSet>::read(*store, in);
// !!! Maybe we want a queryPathInfos?
for (auto & i : paths) {
try {
auto info = store->queryPathInfo(i);
out << store->printStorePath(info->path)
<< (info->deriver ? store->printStorePath(*info->deriver) : "");
- nix::worker_proto::write(*store, out, info->references);
+ WorkerProto<StorePathSet>::write(*store, out, info->references);
// !!! Maybe we want compression?
out << info->narSize // downloadSize
<< info->narSize;
@@ -885,7 +885,7 @@ static void opServe(Strings opFlags, Strings opArgs)
case cmdExportPaths: {
readInt(in); // obsolete
- store->exportPaths(nix::worker_proto::read(*store, in, Phantom<StorePathSet> {}), out);
+ store->exportPaths(WorkerProto<StorePathSet>::read(*store, in), out);
break;
}
@@ -934,9 +934,9 @@ static void opServe(Strings opFlags, Strings opArgs)
case cmdQueryClosure: {
bool includeOutputs = readInt(in);
StorePathSet closure;
- store->computeFSClosure(nix::worker_proto::read(*store, in, Phantom<StorePathSet> {}),
+ store->computeFSClosure(WorkerProto<StorePathSet>::read(*store, in),
closure, false, includeOutputs);
- nix::worker_proto::write(*store, out, closure);
+ WorkerProto<StorePathSet>::write(*store, out, closure);
break;
}
@@ -949,7 +949,7 @@ static void opServe(Strings opFlags, Strings opArgs)
if (deriver != "")
info.deriver = store->parseStorePath(deriver);
info.narHash = Hash::parseAny(readString(in), htSHA256);
- info.references = nix::worker_proto::read(*store, in, Phantom<StorePathSet> {});
+ info.references = WorkerProto<StorePathSet>::read(*store, in);
in >> info.registrationTime >> info.narSize >> info.ultimate;
info.sigs = readStrings<StringSet>(in);
info.ca = parseContentAddressOpt(readString(in));