Commit 5047748f1 for llama.cpp
commit 5047748f114564fcf271e6a648f60e2d2eae6264
Author: Adrien Gallouët <angt@huggingface.co>
Date: Fri Oct 30 20:36:30 2026 +0100
rpc : delete fs_path_to_utf8() (#31424)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
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();
}