mirror of
https://github.com/NixOS/nix
synced 2025-06-30 03:23:16 +02:00
Move value-only methods to InstallableValue
These methods would previously fail on the other `Installable`s, so moving them to this class is more correct as to where they actually work. Additionally, a `InstallableValueCommand` is created to make it easier (or rather no worse than before) to write commands that just work on `InstallableValue`s. Besides being a cleanup to avoid failing default methods, this gets us closer to https://github.com/NixOS/rfcs/pull/134.
This commit is contained in:
parent
acd707acca
commit
c998e0172f
14 changed files with 127 additions and 71 deletions
13
src/libcmd/command-installable-value.hh
Normal file
13
src/libcmd/command-installable-value.hh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "installable-value.hh"
|
||||
#include "command.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
struct InstallableValueCommand : InstallableCommand
|
||||
{
|
||||
virtual void run(ref<Store> store, ref<InstallableValue> installable) = 0;
|
||||
|
||||
void run(ref<Store> store, ref<Installable> installable) override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue