diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-06-27 08:50:24 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-06-27 08:50:24 +0200 |
| commit | d8a8169eb20935b777fbaf322fa2d43e8f29d005 (patch) | |
| tree | e55a23c5c77a2c24b31b3a64911b1b23a07b5391 /src/core/internal_network | |
| parent | 81c6e56713fec564b7bd6519f9f4f760d5680bac (diff) | |
[hle/bsd] do not use rust-result wannabe Expected in functions (#4075)
rust has Result<T,E> but we don't really need that in c++, also the header just sucks, objectively
Signed-off-by: lizzie lizzie@eden-emu.dev
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4075
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: crueter <crueter@eden-emu.dev>
Diffstat (limited to 'src/core/internal_network')
| -rw-r--r-- | src/core/internal_network/network.cpp | 8 | ||||
| -rw-r--r-- | src/core/internal_network/network.h | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/core/internal_network/network.cpp b/src/core/internal_network/network.cpp index c95d7ca2da..077a2e042e 100644 --- a/src/core/internal_network/network.cpp +++ b/src/core/internal_network/network.cpp @@ -28,7 +28,6 @@ #include "common/assert.h" #include "common/common_types.h" -#include "common/expected.h" #include "common/logging.h" #include "common/settings.h" #include "core/internal_network/network.h" @@ -733,15 +732,14 @@ u32 IPv4AddressToInteger(IPv4Address ip_addr) { static_cast<u32>(ip_addr[2]) << 8 | static_cast<u32>(ip_addr[3]); } -Common::Expected<std::vector<AddrInfo>, GetAddrInfoError> GetAddressInfo( +std::variant<std::vector<AddrInfo>, GetAddrInfoError> GetAddressInfo( const std::string& host, const std::optional<std::string>& service) { addrinfo hints{}; hints.ai_family = AF_INET; // Switch only supports IPv4. addrinfo* addrinfo; - s32 gai_err = getaddrinfo(host.c_str(), service.has_value() ? service->c_str() : nullptr, - &hints, &addrinfo); + s32 gai_err = getaddrinfo(host.c_str(), service.has_value() ? service->c_str() : nullptr, &hints, &addrinfo); if (gai_err != 0) { - return Common::Unexpected(TranslateGetAddrInfoErrorFromNative(gai_err)); + return TranslateGetAddrInfoErrorFromNative(gai_err); } std::vector<AddrInfo> ret; for (auto* current = addrinfo; current; current = current->ai_next) { diff --git a/src/core/internal_network/network.h b/src/core/internal_network/network.h index ce259c0e66..2c9ae523c5 100644 --- a/src/core/internal_network/network.h +++ b/src/core/internal_network/network.h @@ -9,6 +9,7 @@ #include <array> #include <optional> #include <vector> +#include <variant> #include "common/common_funcs.h" #include "common/common_types.h" @@ -124,7 +125,6 @@ std::string IPv4AddressToString(IPv4Address ip_addr); u32 IPv4AddressToInteger(IPv4Address ip_addr); // named to avoid name collision with Windows macro -Common::Expected<std::vector<AddrInfo>, GetAddrInfoError> GetAddressInfo( - const std::string& host, const std::optional<std::string>& service); +std::variant<std::vector<AddrInfo>, GetAddrInfoError> GetAddressInfo(const std::string& host, const std::optional<std::string>& service); } // namespace Network |
