From 5047748f114564fcf271e6a648f60e2d2eae6264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Fri, 30 Oct 2026 20:36:30 +0100 Subject: [PATCH] rpc : delete fs_path_to_utf8() (#31424) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- tools/rpc/rpc-server.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/rpc/rpc-server.cpp b/tools/rpc/rpc-server.cpp index 2ae11cb3b..7cb25947d 100644 --- a/tools/rpc/rpc-server.cpp +++ b/tools/rpc/rpc-server.cpp @@ -24,12 +24,6 @@ #endif -// NOTE: this is copied from common.cpp to avoid linking with libcommon -static std::string fs_path_to_utf8(const std::filesystem::path & path) { - const auto value = path.u8string(); - return std::string(value.begin(), value.end()); -} - // common_get_path_from_env() is adapted to avoid utf8_to_wstring static std::filesystem::path common_get_path_from_env(const std::string & name) { #ifdef _WIN32 @@ -244,10 +238,10 @@ int main(int argc, char * argv[]) { std::error_code ec; common_create_directories(cache_dir_path, ec); if (ec) { - fprintf(stderr, "Failed to create cache directory: %s\n", fs_path_to_utf8(cache_dir_path).c_str()); + fprintf(stderr, "Failed to create cache directory: %s\n", cache_dir_path.string().c_str()); return 1; } - cache_dir_str = fs_path_to_utf8(cache_dir_path); + cache_dir_str = cache_dir_path.string(); cache_dir = cache_dir_str.c_str(); }