diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-05-24 20:45:05 -0600 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-05-24 20:45:05 -0600 |
commit | 2a7a824d83dc5fb33326b8b89625685f283a743b (patch) | |
tree | c5a577ddfbf53bd4f86725702bfbb558ac6e92cc /src/libstore/store-api.cc | |
parent | 076c19e0d1a6ad226d002a359df666216fa97950 (diff) |
libstore: parse the buildMode instead of unchecked cast
Change-Id: Icf6af7935e8f139bef36b40ad475e973aa48855c
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 509b0fa68..ed3566f5e 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -22,6 +22,14 @@ using json = nlohmann::json; namespace nix { +BuildMode buildModeFromInteger(int raw) { + switch (raw) { + case bmNormal: return bmNormal; + case bmRepair: return bmRepair; + case bmCheck: return bmCheck; + default: throw Error("Invalid BuildMode"); + } +} bool Store::isInStore(PathView path) const { |