From e0f77beadcc1eb92d6cfb83752c17a4fdda1f772 Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Tue, 1 Apr 2025 20:36:53 +0200 Subject: [PATCH] Migrate from fmt/format to std/format --- CMakeLists.txt | 2 -- src/espstrutils.cpp | 12 +++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f2827c..bf9053b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,10 +34,8 @@ set(dependencies esp_hw_support esp_websocket_client tcp_transport - cpputils espchrono - fmt ) idf_component_register( diff --git a/src/espstrutils.cpp b/src/espstrutils.cpp index 684689a..1a7a377 100644 --- a/src/espstrutils.cpp +++ b/src/espstrutils.cpp @@ -5,13 +5,11 @@ // system includes #include +#include // esp-idf includes #include -// 3rdparty lib includes -#include - using namespace std::string_literals; namespace espcpputils { @@ -27,7 +25,7 @@ std::string toString(sntp_sync_mode_t val) case SNTP_SYNC_MODE_SMOOTH: return "SMOOTH"; default: ESP_LOGW(TAG, "unknown sntp_sync_mode_t(%i)", std::to_underlying(val)); - return fmt::format("Unknown sntp_sync_mode_t({})", std::to_underlying(val)); + return std::format("Unknown sntp_sync_mode_t({})", std::to_underlying(val)); } } @@ -40,7 +38,7 @@ std::string toString(sntp_sync_status_t val) case SNTP_SYNC_STATUS_IN_PROGRESS: return "IN_PROGRESS"; default: ESP_LOGW(TAG, "unknown sntp_sync_status_t(%i)", std::to_underlying(val)); - return fmt::format("Unknown sntp_sync_status_t({})", std::to_underlying(val)); + return std::format("Unknown sntp_sync_status_t({})", std::to_underlying(val)); } } @@ -56,7 +54,7 @@ std::string toString(esp_log_level_t val) case ESP_LOG_VERBOSE: return "VERBOSE"; default: ESP_LOGW(TAG, "unknown esp_log_level_t(%i)", std::to_underlying(val)); - return fmt::format("Unknown esp_log_level_t({})", std::to_underlying(val)); + return std::format("Unknown esp_log_level_t({})", std::to_underlying(val)); } } @@ -77,7 +75,7 @@ std::string toString(esp_reset_reason_t val) case ESP_RST_SDIO: return "SDIO"; default: ESP_LOGW(TAG, "unknown esp_reset_reason_t(%i)", std::to_underlying(val)); - return fmt::format("Unknown esp_reset_reason_t({})", std::to_underlying(val)); + return std::format("Unknown esp_reset_reason_t({})", std::to_underlying(val)); } }