Fixed some tidy warnings

This commit is contained in:
gabime 2024-12-05 18:10:34 +02:00
parent 1fcdd8c021
commit 72b2ca0462
4 changed files with 9 additions and 13 deletions

View File

@ -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 <typename T, typename... Args>
[[nodiscard]] constexpr fmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> 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

View File

@ -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()};
}

View File

@ -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;

View File

@ -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 <typename... Args>