actually now

This commit is contained in:
matcool 2024-11-09 16:04:38 -03:00
parent e8ef9b79c8
commit 13b7cfc488

View file

@ -124,11 +124,11 @@ namespace geode {
Result<T> parseLaunchArgument(std::string_view const name) const { Result<T> parseLaunchArgument(std::string_view const name) const {
auto str = this->getLaunchArgument(name); auto str = this->getLaunchArgument(name);
if (!str.has_value()) { if (!str.has_value()) {
return Err("Launch argument '{}' not found", name); return Err(fmt::format("Launch argument '{}' not found", name));
} }
auto jsonOpt = matjson::Value::parse(str.value()); auto jsonOpt = matjson::Value::parse(str.value());
if (jsonOpt.isErr()) { if (jsonOpt.isErr()) {
return Err("Parsing launch argument '{}' failed: {}", name, jsonOpt.unwrapErr()); return Err(fmt::format("Parsing launch argument '{}' failed: {}", name, jsonOpt.unwrapErr()));
} }
auto value = jsonOpt.unwrap(); auto value = jsonOpt.unwrap();
return value.template as<T>(); return value.template as<T>();