From 2678836e4a5bc02a84121a2e2883eed1ec4bf0a5 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 19 Jan 2025 16:40:26 +0100 Subject: [PATCH] libstore: make BinaryCacheStore::getFile abstract all extant derived classes implement this method, making the default implementation not very useful. should it ever be needed again it'll be easy enough for derived classes to return an owning StringSource. Change-Id: I65e041e7a4e7b161f0f404f4287cea5440b5a749 --- lix/libstore/binary-cache-store.cc | 7 ------- lix/libstore/binary-cache-store.hh | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lix/libstore/binary-cache-store.cc b/lix/libstore/binary-cache-store.cc index 3af54d4d9..609dc962a 100644 --- a/lix/libstore/binary-cache-store.cc +++ b/lix/libstore/binary-cache-store.cc @@ -65,13 +65,6 @@ void BinaryCacheStore::upsertFile(const std::string & path, upsertFile(path, std::make_shared(std::move(data)), mimeType); } -box_ptr BinaryCacheStore::getFile(const std::string & path) -{ - return make_box_ptr([](std::string data) -> Generator { - co_yield std::span{data.data(), data.size()}; - }(std::move(*getFileContents(path)))); -} - std::optional BinaryCacheStore::getFileContents(const std::string & path) { StringSink sink; diff --git a/lix/libstore/binary-cache-store.hh b/lix/libstore/binary-cache-store.hh index 538da50b6..a8a393133 100644 --- a/lix/libstore/binary-cache-store.hh +++ b/lix/libstore/binary-cache-store.hh @@ -85,7 +85,7 @@ public: /** * Dump the contents of the specified file to a sink. */ - virtual box_ptr getFile(const std::string & path); + virtual box_ptr getFile(const std::string & path) = 0; virtual std::optional getFileContents(const std::string & path);