aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-08 17:45:19 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-11 13:27:38 +0000
commit073e134de6260de7d90b135b7e173157741d4853 (patch)
treef35f9491e2da62f14caedf00ea9e174eabd8e924 /src/libstore
parentaee56e0f895e7b9890d1ec948b24c75478f9e88e (diff)
Rename `requireGcStore` to `GcStore::require`
I should have done this to begin with. This will be nicer once more Store sub-interfaces exist too, to illustrate the pattern.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/daemon.cc6
-rw-r--r--src/libstore/gc-store.cc2
-rw-r--r--src/libstore/gc-store.hh4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index e6760664c..ffc605410 100644
--- a/src/libstore/daemon.cc
+++ b/src/libstore/daemon.cc
@@ -645,7 +645,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
Path path = absPath(readString(from));
logger->startWork();
- auto & gcStore = requireGcStore(*store);
+ auto & gcStore = GcStore::require(*store);
gcStore.addIndirectRoot(path);
logger->stopWork();
@@ -663,7 +663,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
case wopFindRoots: {
logger->startWork();
- auto & gcStore = requireGcStore(*store);
+ auto & gcStore = GcStore::require(*store);
Roots roots = gcStore.findRoots(!trusted);
logger->stopWork();
@@ -695,7 +695,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
logger->startWork();
if (options.ignoreLiveness)
throw Error("you are not allowed to ignore liveness");
- auto & gcStore = requireGcStore(*store);
+ auto & gcStore = GcStore::require(*store);
gcStore.collectGarbage(options, results);
logger->stopWork();
diff --git a/src/libstore/gc-store.cc b/src/libstore/gc-store.cc
index 3dbdec53b..4516cc744 100644
--- a/src/libstore/gc-store.cc
+++ b/src/libstore/gc-store.cc
@@ -2,7 +2,7 @@
namespace nix {
-GcStore & requireGcStore(Store & store)
+GcStore & GcStore::require(Store & store)
{
auto * gcStore = dynamic_cast<GcStore *>(&store);
if (!gcStore)
diff --git a/src/libstore/gc-store.hh b/src/libstore/gc-store.hh
index 829f70dc4..462cc097b 100644
--- a/src/libstore/gc-store.hh
+++ b/src/libstore/gc-store.hh
@@ -77,8 +77,8 @@ struct GcStore : public virtual Store
/* Perform a garbage collection. */
virtual void collectGarbage(const GCOptions & options, GCResults & results) = 0;
-};
-GcStore & requireGcStore(Store & store);
+ static GcStore & require(Store & store);
+};
}