1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

libstore: Introduce WorkerProto::FeatureSet alias

Unfortunately Feature is just an alias to `std::string`
and not a new-type, so a ton of code relies on it being
exactly a `std::string`.

Using transparent comparators just for StringSet necessitates
using it here as well.
This commit is contained in:
Sergei Zimmerman 2025-05-02 17:40:34 +00:00
parent 55815ec225
commit 5278cd2396
No known key found for this signature in database
GPG key ID: A9B0B557CA632325
4 changed files with 20 additions and 26 deletions

View file

@ -685,7 +685,7 @@ TEST_F(WorkerProtoTest, handshake_features)
toClient.create();
toServer.create();
std::tuple<WorkerProto::Version, std::set<WorkerProto::Feature>> clientResult;
std::tuple<WorkerProto::Version, WorkerProto::FeatureSet> clientResult;
auto clientThread = std::thread([&]() {
FdSink out { toServer.writeSide.get() };
@ -703,7 +703,7 @@ TEST_F(WorkerProtoTest, handshake_features)
EXPECT_EQ(clientResult, daemonResult);
EXPECT_EQ(std::get<0>(clientResult), 123u);
EXPECT_EQ(std::get<1>(clientResult), std::set<WorkerProto::Feature>({"bar", "xyzzy"}));
EXPECT_EQ(std::get<1>(clientResult), WorkerProto::FeatureSet({"bar", "xyzzy"}));
}
/// Has to be a `BufferedSink` for handshake.