mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
add missing formatter for Snowflake
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <cstdint>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
struct Snowflake {
|
||||
Snowflake();
|
||||
@@ -39,6 +40,13 @@ private:
|
||||
unsigned long long m_num;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct fmt::formatter<Snowflake> : fmt::formatter<std::string> {
|
||||
auto format(Snowflake id, format_context &ctx) -> decltype(ctx.out()) {
|
||||
return format_to(ctx.out(), "[id: {}]", static_cast<uint64_t>(id));
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template<>
|
||||
struct hash<Snowflake> {
|
||||
|
||||
Reference in New Issue
Block a user