diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-02-05 12:16:17 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-03-16 20:06:46 -0400 |
commit | c998e0172f31fd5707a8361962ec99b3ff9b1b10 (patch) | |
tree | c8556e4e261fb80faebe66558b5bcccf92d1b26f /src/nix/edit.cc | |
parent | acd707acca8acbc276af5181c7724c70a6a69ad5 (diff) |
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.
Diffstat (limited to 'src/nix/edit.cc')
-rw-r--r-- | src/nix/edit.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nix/edit.cc b/src/nix/edit.cc index c46c1c23c..66629fab0 100644 --- a/src/nix/edit.cc +++ b/src/nix/edit.cc @@ -1,4 +1,4 @@ -#include "command.hh" +#include "command-installable-value.hh" #include "shared.hh" #include "eval.hh" #include "attr-path.hh" @@ -9,7 +9,7 @@ using namespace nix; -struct CmdEdit : InstallableCommand +struct CmdEdit : InstallableValueCommand { std::string description() override { @@ -25,7 +25,7 @@ struct CmdEdit : InstallableCommand Category category() override { return catSecondary; } - void run(ref<Store> store, ref<Installable> installable) override + void run(ref<Store> store, ref<InstallableValue> installable) override { auto state = getEvalState(); |