aboutsummaryrefslogtreecommitdiff
path: root/src/nix/store-gc.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-09 15:27:48 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-11 13:32:33 +0000
commita03b1fd7f60788304f358d5f4dc063c7c9e650a9 (patch)
treee5ec34a44b96ad4b384aca9343033292b26606fb /src/nix/store-gc.cc
parent678d1c2aa0f499466c723d3461277dc197515f57 (diff)
Deduplicate the Store downcasting with a template
Diffstat (limited to 'src/nix/store-gc.cc')
-rw-r--r--src/nix/store-gc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix/store-gc.cc b/src/nix/store-gc.cc
index 515f4ffdb..8b9b5d164 100644
--- a/src/nix/store-gc.cc
+++ b/src/nix/store-gc.cc
@@ -2,6 +2,7 @@
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
+#include "store-cast.hh"
#include "gc-store.hh"
using namespace nix;
@@ -34,7 +35,7 @@ struct CmdStoreGC : StoreCommand, MixDryRun
void run(ref<Store> store) override
{
- auto & gcStore = GcStore::require(*store);
+ auto & gcStore = require<GcStore>(*store);
options.action = dryRun ? GCOptions::gcReturnDead : GCOptions::gcDeleteDead;
GCResults results;