diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-05 19:44:08 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-05 19:44:08 +0000 |
commit | ed96e603e116123c1e44f5108b67b472b2c96538 (patch) | |
tree | 71278cdbc658d63f3d07ca6ac4fda2909f58b27b /src/libstore/worker-protocol.hh | |
parent | cf939055c867492306178f951b2f244d1f3f5062 (diff) |
Proxy -> Phantom to match Rust
Sorry, Haskell.
Diffstat (limited to 'src/libstore/worker-protocol.hh')
-rw-r--r-- | src/libstore/worker-protocol.hh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index 117d3e1a4..384b81f08 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -72,16 +72,16 @@ void writeStorePaths(const Store & store, Sink & out, const StorePathSet & paths /* To guide overloading */ template<typename T> -struct Proxy {}; +struct Phantom {}; template<typename T> -std::map<std::string, T> read(const Store & store, Source & from, Proxy<std::map<std::string, T>> _) +std::map<std::string, T> read(const Store & store, Source & from, Phantom<std::map<std::string, T>> _) { std::map<string, T> resMap; auto size = (size_t)readInt(from); while (size--) { auto thisKey = readString(from); - resMap.insert_or_assign(std::move(thisKey), read(store, from, Proxy<T> {})); + resMap.insert_or_assign(std::move(thisKey), read(store, from, Phantom<T> {})); } return resMap; } @@ -97,14 +97,14 @@ void write(const Store & store, Sink & out, const std::map<string, T> & resMap) } template<typename T> -std::optional<T> read(const Store & store, Source & from, Proxy<std::optional<T>> _) +std::optional<T> read(const Store & store, Source & from, Phantom<std::optional<T>> _) { auto tag = readNum<uint8_t>(from); switch (tag) { case 0: return std::nullopt; case 1: - return read(store, from, Proxy<T> {}); + return read(store, from, Phantom<T> {}); default: throw Error("got an invalid tag bit for std::optional: %#04x", tag); } @@ -118,7 +118,7 @@ void write(const Store & store, Sink & out, const std::optional<T> & optVal) write(store, out, *optVal); } -StorePath read(const Store & store, Source & from, Proxy<StorePath> _); +StorePath read(const Store & store, Source & from, Phantom<StorePath> _); void write(const Store & store, Sink & out, const StorePath & storePath); |