aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/experimental-features.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-05-04 14:10:21 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-05-04 14:10:21 +0200
commitc98648bef06fa749da156f11c61c97a8b066b271 (patch)
tree1e4352b74dd116073a1ce85ade2feaa52ab4a8a0 /src/libutil/experimental-features.cc
parentc81ffa692e56cd8a1069aea95159008a342e0f46 (diff)
parent470e27ce8008ba952225b9f9f7f61a9627376f33 (diff)
Merge remote-tracking branch 'origin/master' into debug-exploratory-PR
Diffstat (limited to 'src/libutil/experimental-features.cc')
-rw-r--r--src/libutil/experimental-features.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc
index df37edf57..315de64a4 100644
--- a/src/libutil/experimental-features.cc
+++ b/src/libutil/experimental-features.cc
@@ -35,7 +35,9 @@ const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::str
std::string_view showExperimentalFeature(const ExperimentalFeature feature)
{
- return stringifiedXpFeatures.at(feature);
+ const auto ret = get(stringifiedXpFeatures, feature);
+ assert(ret);
+ return *ret;
}
std::set<ExperimentalFeature> parseFeatures(const std::set<std::string> & rawFeatures)
@@ -58,11 +60,13 @@ std::ostream & operator <<(std::ostream & str, const ExperimentalFeature & featu
return str << showExperimentalFeature(feature);
}
-void to_json(nlohmann::json& j, const ExperimentalFeature& feature) {
+void to_json(nlohmann::json & j, const ExperimentalFeature & feature)
+{
j = showExperimentalFeature(feature);
}
-void from_json(const nlohmann::json& j, ExperimentalFeature& feature) {
+void from_json(const nlohmann::json & j, ExperimentalFeature & feature)
+{
const std::string input = j;
const auto parsed = parseExperimentalFeature(input);