From 3447dbfb2c0f3bf7e31577bf2d5908b14ba59601 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Thu, 16 May 2024 17:58:27 +0200 Subject: libstore: rewrite narFromPath as generator Change-Id: Ifa783c2c65c06ddd1d0212016d5bfd07666ea91c --- src/libstore/remote-store.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstore/remote-store.cc') diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 9cebdbe82..9ff01351c 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -848,12 +848,14 @@ RemoteStore::Connection::~Connection() } } -void RemoteStore::narFromPath(const StorePath & path, Sink & sink) +WireFormatGenerator RemoteStore::narFromPath(const StorePath & path) { auto conn(connections->get()); conn->to << WorkerProto::Op::NarFromPath << printStorePath(path); conn->processStderr(); - sink << copyNAR(conn->from); + return [](auto conn) -> WireFormatGenerator { + co_yield copyNAR(conn->from); + }(std::move(conn)); } ref RemoteStore::getFSAccessor() -- cgit v1.2.3