mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Fixed some tidy warnings
This commit is contained in:
parent
1fcdd8c021
commit
72b2ca0462
@ -159,17 +159,10 @@ struct file_event_handlers {
|
|||||||
|
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
// to_string_view
|
// // to_string_view
|
||||||
[[nodiscard]] constexpr spdlog::string_view_t to_string_view(const memory_buf_t &buf) noexcept {
|
// [[nodiscard]] constexpr spdlog::string_view_t to_string_view(const memory_buf_t &buf) noexcept {
|
||||||
return spdlog::string_view_t{buf.data(), buf.size()};
|
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace details
|
} // namespace details
|
||||||
} // namespace spdlog
|
} // namespace spdlog
|
||||||
|
@ -31,3 +31,8 @@
|
|||||||
#include "spdlog/sinks/null_sink.h"
|
#include "spdlog/sinks/null_sink.h"
|
||||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||||
#include "spdlog/spdlog.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()};
|
||||||
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
|
|
||||||
using spdlog::memory_buf_t;
|
using spdlog::memory_buf_t;
|
||||||
using spdlog::details::to_string_view;
|
|
||||||
|
|
||||||
void test_pad2(int n, const char *expected) {
|
void test_pad2(int n, const char *expected) {
|
||||||
memory_buf_t buf;
|
memory_buf_t buf;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include "test_sink.h"
|
#include "test_sink.h"
|
||||||
|
|
||||||
using spdlog::memory_buf_t;
|
using spdlog::memory_buf_t;
|
||||||
using spdlog::details::to_string_view;
|
|
||||||
|
|
||||||
// log to str and return it
|
// log to str and return it
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
|
Loading…
Reference in New Issue
Block a user