summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/setup_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/setup_utils.cpp')
-rw-r--r--src/other_tools/just_mr/setup_utils.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/other_tools/just_mr/setup_utils.cpp b/src/other_tools/just_mr/setup_utils.cpp
index 4ed6f94d..1c55c9a3 100644
--- a/src/other_tools/just_mr/setup_utils.cpp
+++ b/src/other_tools/just_mr/setup_utils.cpp
@@ -259,19 +259,15 @@ auto CreateServeConfig(std::optional<std::string> const& remote_serve_addr,
MultiRepoRemoteAuthArguments const& auth) noexcept
-> std::optional<RemoteServeConfig> {
RemoteServeConfig::Builder builder;
- auto result = builder.SetRemoteAddress(remote_serve_addr).Build();
+ auto config = builder.SetRemoteAddress(remote_serve_addr).Build();
- if (auto* config = std::get_if<RemoteServeConfig>(&result)) {
+ if (config) {
// setup authentication
SetupAuthConfig(auth);
- return std::move(*config);
+ return *std::move(config);
}
- if (auto* error = std::get_if<std::string>(&result)) {
- Logger::Log(LogLevel::Error, *error);
- return std::nullopt;
- }
- Logger::Log(LogLevel::Error, "Unknown error occured");
+ Logger::Log(LogLevel::Error, config.error());
return std::nullopt;
}