run(): Move

This commit is contained in:
Eelco Dolstra
2021-09-27 11:12:06 +02:00
parent 283e7da470
commit a15e65eef0
10 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -138,7 +138,7 @@ StorePathsCommand::StorePathsCommand(bool recursive)
{
}
void StorePathsCommand::run(ref<Store> store, BuiltPaths paths)
void StorePathsCommand::run(ref<Store> store, BuiltPaths && paths)
{
StorePaths storePaths;
for (auto& builtPath : paths)
@@ -148,7 +148,7 @@ void StorePathsCommand::run(ref<Store> store, BuiltPaths paths)
run(store, std::move(storePaths));
}
void StorePathCommand::run(ref<Store> store, std::vector<StorePath> storePaths)
void StorePathCommand::run(ref<Store> store, std::vector<StorePath> && storePaths)
{
if (storePaths.size() != 1)
throw UsageError("this command requires exactly one store path");
+4 -4
View File
@@ -169,7 +169,7 @@ public:
using StoreCommand::run;
virtual void run(ref<Store> store, BuiltPaths paths) = 0;
virtual void run(ref<Store> store, BuiltPaths && paths) = 0;
void run(ref<Store> store) override;
@@ -182,9 +182,9 @@ struct StorePathsCommand : public BuiltPathsCommand
using BuiltPathsCommand::run;
virtual void run(ref<Store> store, std::vector<StorePath> storePaths) = 0;
virtual void run(ref<Store> store, std::vector<StorePath> && storePaths) = 0;
void run(ref<Store> store, BuiltPaths paths) override;
void run(ref<Store> 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> store, const StorePath & storePath) = 0;
void run(ref<Store> store, std::vector<StorePath> storePaths) override;
void run(ref<Store> store, std::vector<StorePath> && storePaths) override;
};
/* A helper class for registering commands globally. */
+1 -1
View File
@@ -78,7 +78,7 @@ struct CmdCopy : BuiltPathsCommand
BuiltPathsCommand::run(store);
}
void run(ref<Store> srcStore, BuiltPaths paths) override
void run(ref<Store> srcStore, BuiltPaths && paths) override
{
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
+1 -1
View File
@@ -25,7 +25,7 @@ struct CmdMakeContentAddressable : StorePathsCommand, MixJSON
;
}
void run(ref<Store> store, StorePaths storePaths) override
void run(ref<Store> store, StorePaths && storePaths) override
{
auto paths = store->topoSortPaths(StorePathSet(storePaths.begin(), storePaths.end()));
+1 -1
View File
@@ -79,7 +79,7 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
std::cout << fmt("\t%6.1f%c", res, idents.at(power));
}
void run(ref<Store> store, StorePaths storePaths) override
void run(ref<Store> store, StorePaths && storePaths) override
{
size_t pathLen = 0;
for (auto & storePath : storePaths)
+1 -1
View File
@@ -44,7 +44,7 @@ struct CmdRealisationInfo : BuiltPathsCommand, MixJSON
Category category() override { return catSecondary; }
void run(ref<Store> store, BuiltPaths paths) override
void run(ref<Store> store, BuiltPaths && paths) override
{
settings.requireExperimentalFeature("ca-derivations");
RealisedPath::Set realisations;
+2 -2
View File
@@ -27,7 +27,7 @@ struct CmdCopySigs : StorePathsCommand
return "copy store path signatures from substituters";
}
void run(ref<Store> store, StorePaths storePaths) override
void run(ref<Store> 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> store, StorePaths storePaths) override
void run(ref<Store> store, StorePaths && storePaths) override
{
if (secretKeyFile.empty())
throw UsageError("you must specify a secret key file using '-k'");
+1 -1
View File
@@ -30,7 +30,7 @@ struct CmdStoreDelete : StorePathsCommand
;
}
void run(ref<Store> store, std::vector<StorePath> storePaths) override
void run(ref<Store> store, std::vector<StorePath> && storePaths) override
{
for (auto & path : storePaths)
options.pathsToDelete.insert(path);
+1 -1
View File
@@ -17,7 +17,7 @@ struct CmdStoreRepair : StorePathsCommand
;
}
void run(ref<Store> store, std::vector<StorePath> storePaths) override
void run(ref<Store> store, std::vector<StorePath> && storePaths) override
{
for (auto & path : storePaths)
store->repairPath(path);
+1 -1
View File
@@ -59,7 +59,7 @@ struct CmdVerify : StorePathsCommand
;
}
void run(ref<Store> store, StorePaths storePaths) override
void run(ref<Store> store, StorePaths && storePaths) override
{
std::vector<ref<Store>> substituters;
for (auto & s : substituterUris)