From a15e65eef0443a4d41b1a9e9b1504234dc5f5947 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Sep 2021 10:53:09 +0200 Subject: [PATCH] run(): Move --- src/libcmd/command.cc | 4 ++-- src/libcmd/command.hh | 8 ++++---- src/nix/copy.cc | 2 +- src/nix/make-content-addressable.cc | 2 +- src/nix/path-info.cc | 2 +- src/nix/realisation.cc | 2 +- src/nix/sigs.cc | 4 ++-- src/nix/store-delete.cc | 2 +- src/nix/store-repair.cc | 2 +- src/nix/verify.cc | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index 2daf43aa7..2b9902677 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -138,7 +138,7 @@ StorePathsCommand::StorePathsCommand(bool recursive) { } -void StorePathsCommand::run(ref store, BuiltPaths paths) +void StorePathsCommand::run(ref store, BuiltPaths && paths) { StorePaths storePaths; for (auto& builtPath : paths) @@ -148,7 +148,7 @@ void StorePathsCommand::run(ref store, BuiltPaths paths) run(store, std::move(storePaths)); } -void StorePathCommand::run(ref store, std::vector storePaths) +void StorePathCommand::run(ref store, std::vector && storePaths) { if (storePaths.size() != 1) throw UsageError("this command requires exactly one store path"); diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh index dac146d24..07f398468 100644 --- a/src/libcmd/command.hh +++ b/src/libcmd/command.hh @@ -169,7 +169,7 @@ public: using StoreCommand::run; - virtual void run(ref store, BuiltPaths paths) = 0; + virtual void run(ref store, BuiltPaths && paths) = 0; void run(ref store) override; @@ -182,9 +182,9 @@ struct StorePathsCommand : public BuiltPathsCommand using BuiltPathsCommand::run; - virtual void run(ref store, std::vector storePaths) = 0; + virtual void run(ref store, std::vector && storePaths) = 0; - void run(ref store, BuiltPaths paths) override; + void run(ref store, BuiltPaths && paths) override; }; /* A command that operates on exactly one store path. */ @@ -194,7 +194,7 @@ struct StorePathCommand : public StorePathsCommand virtual void run(ref store, const StorePath & storePath) = 0; - void run(ref store, std::vector storePaths) override; + void run(ref store, std::vector && storePaths) override; }; /* A helper class for registering commands globally. */ diff --git a/src/nix/copy.cc b/src/nix/copy.cc index 0489dfe06..197c85316 100644 --- a/src/nix/copy.cc +++ b/src/nix/copy.cc @@ -78,7 +78,7 @@ struct CmdCopy : BuiltPathsCommand BuiltPathsCommand::run(store); } - void run(ref srcStore, BuiltPaths paths) override + void run(ref srcStore, BuiltPaths && paths) override { ref dstStore = dstUri.empty() ? openStore() : openStore(dstUri); diff --git a/src/nix/make-content-addressable.cc b/src/nix/make-content-addressable.cc index f5bdc7e65..12f303a10 100644 --- a/src/nix/make-content-addressable.cc +++ b/src/nix/make-content-addressable.cc @@ -25,7 +25,7 @@ struct CmdMakeContentAddressable : StorePathsCommand, MixJSON ; } - void run(ref store, StorePaths storePaths) override + void run(ref store, StorePaths && storePaths) override { auto paths = store->topoSortPaths(StorePathSet(storePaths.begin(), storePaths.end())); diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc index 518cd5568..3743d7504 100644 --- a/src/nix/path-info.cc +++ b/src/nix/path-info.cc @@ -79,7 +79,7 @@ struct CmdPathInfo : StorePathsCommand, MixJSON std::cout << fmt("\t%6.1f%c", res, idents.at(power)); } - void run(ref store, StorePaths storePaths) override + void run(ref store, StorePaths && storePaths) override { size_t pathLen = 0; for (auto & storePath : storePaths) diff --git a/src/nix/realisation.cc b/src/nix/realisation.cc index d59e594df..dfa8ff449 100644 --- a/src/nix/realisation.cc +++ b/src/nix/realisation.cc @@ -44,7 +44,7 @@ struct CmdRealisationInfo : BuiltPathsCommand, MixJSON Category category() override { return catSecondary; } - void run(ref store, BuiltPaths paths) override + void run(ref store, BuiltPaths && paths) override { settings.requireExperimentalFeature("ca-derivations"); RealisedPath::Set realisations; diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc index c64b472b6..43e0d9148 100644 --- a/src/nix/sigs.cc +++ b/src/nix/sigs.cc @@ -27,7 +27,7 @@ struct CmdCopySigs : StorePathsCommand return "copy store path signatures from substituters"; } - void run(ref store, StorePaths storePaths) override + void run(ref store, StorePaths && storePaths) override { if (substituterUris.empty()) throw UsageError("you must specify at least one substituter using '-s'"); @@ -113,7 +113,7 @@ struct CmdSign : StorePathsCommand return "sign store paths"; } - void run(ref store, StorePaths storePaths) override + void run(ref store, StorePaths && storePaths) override { if (secretKeyFile.empty()) throw UsageError("you must specify a secret key file using '-k'"); diff --git a/src/nix/store-delete.cc b/src/nix/store-delete.cc index 10245978e..e4a3cb554 100644 --- a/src/nix/store-delete.cc +++ b/src/nix/store-delete.cc @@ -30,7 +30,7 @@ struct CmdStoreDelete : StorePathsCommand ; } - void run(ref store, std::vector storePaths) override + void run(ref store, std::vector && storePaths) override { for (auto & path : storePaths) options.pathsToDelete.insert(path); diff --git a/src/nix/store-repair.cc b/src/nix/store-repair.cc index 1c7a4392e..8fcb3639a 100644 --- a/src/nix/store-repair.cc +++ b/src/nix/store-repair.cc @@ -17,7 +17,7 @@ struct CmdStoreRepair : StorePathsCommand ; } - void run(ref store, std::vector storePaths) override + void run(ref store, std::vector && storePaths) override { for (auto & path : storePaths) store->repairPath(path); diff --git a/src/nix/verify.cc b/src/nix/verify.cc index f5a576064..e92df1303 100644 --- a/src/nix/verify.cc +++ b/src/nix/verify.cc @@ -59,7 +59,7 @@ struct CmdVerify : StorePathsCommand ; } - void run(ref store, StorePaths storePaths) override + void run(ref store, StorePaths && storePaths) override { std::vector> substituters; for (auto & s : substituterUris)