From 72b2ca04622a110a5e799062a56809c89afd2752 Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 5 Dec 2024 18:10:34 +0200 Subject: [PATCH] Fixed some tidy warnings --- include/spdlog/common.h | 15 ++++----------- tests/includes.h | 5 +++++ tests/test_fmt_helper.cpp | 1 - tests/test_pattern_formatter.cpp | 1 - 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 90964cb5..15718b12 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -159,17 +159,10 @@ struct file_event_handlers { namespace details { -// to_string_view -[[nodiscard]] constexpr spdlog::string_view_t to_string_view(const memory_buf_t &buf) noexcept { - return spdlog::string_view_t{buf.data(), buf.size()}; -} - -//[[nodiscard]] constexpr spdlog::string_view_t to_string_view(spdlog::string_view_t str) noexcept { return str; } - -template -[[nodiscard]] constexpr fmt::basic_string_view to_string_view(fmt::basic_format_string fmt) noexcept { - return fmt; -} +// // to_string_view +// [[nodiscard]] constexpr spdlog::string_view_t to_string_view(const memory_buf_t &buf) noexcept { +// return spdlog::string_view_t{buf.data(), buf.size()}; +// } } // namespace details } // namespace spdlog diff --git a/tests/includes.h b/tests/includes.h index d08001c1..f45174b5 100644 --- a/tests/includes.h +++ b/tests/includes.h @@ -31,3 +31,8 @@ #include "spdlog/sinks/null_sink.h" #include "spdlog/sinks/stdout_color_sinks.h" #include "spdlog/spdlog.h" + +// to_string_view +[[nodiscard]] constexpr spdlog::string_view_t to_string_view(const spdlog::memory_buf_t &buf) noexcept { + return spdlog::string_view_t{buf.data(), buf.size()}; +} diff --git a/tests/test_fmt_helper.cpp b/tests/test_fmt_helper.cpp index 31b93067..6bd0245f 100644 --- a/tests/test_fmt_helper.cpp +++ b/tests/test_fmt_helper.cpp @@ -2,7 +2,6 @@ #include "includes.h" using spdlog::memory_buf_t; -using spdlog::details::to_string_view; void test_pad2(int n, const char *expected) { memory_buf_t buf; diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index 1da38ed3..fd75cb97 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -3,7 +3,6 @@ #include "test_sink.h" using spdlog::memory_buf_t; -using spdlog::details::to_string_view; // log to str and return it template