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:
parent
678d1c2aa0
commit
a03b1fd7f6
11 changed files with 39 additions and 41 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue