1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Deduplicate the Store downcasting with a template

This commit is contained in:
John Ericson 2022-03-09 15:27:48 +00:00
parent 678d1c2aa0
commit a03b1fd7f6
11 changed files with 39 additions and 41 deletions

View file

@ -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);