aboutsummaryrefslogtreecommitdiff
path: root/src/nix-collect-garbage
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-collect-garbage
parent678d1c2aa0f499466c723d3461277dc197515f57 (diff)
Deduplicate the Store downcasting with a template
Diffstat (limited to 'src/nix-collect-garbage')
-rw-r--r--src/nix-collect-garbage/nix-collect-garbage.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix-collect-garbage/nix-collect-garbage.cc b/src/nix-collect-garbage/nix-collect-garbage.cc
index b61f0e640..af6f1c88c 100644
--- a/src/nix-collect-garbage/nix-collect-garbage.cc
+++ b/src/nix-collect-garbage/nix-collect-garbage.cc
@@ -1,4 +1,5 @@
#include "store-api.hh"
+#include "store-cast.hh"
#include "gc-store.hh"
#include "profiles.hh"
#include "shared.hh"
@@ -81,7 +82,7 @@ static int main_nix_collect_garbage(int argc, char * * argv)
// Run the actual garbage collector.
if (!dryRun) {
auto store = openStore();
- auto & gcStore = GcStore::require(*store);
+ auto & gcStore = require<GcStore>(*store);
options.action = GCOptions::gcDeleteDead;
GCResults results;
PrintFreed freed(true, results);