repair: add fmt::formatter for repair_hash

before this change, we rely on the default-generated fmt::formatter created
from operator<<, but fmt v10 dropped the default-generated formatter.

in this change, we define formatters for repair_hash.

Refs #13245

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2024-03-09 23:15:51 +08:00
parent 9f97d21339
commit 39ee8593cb

View File

@@ -2,6 +2,7 @@
#include <absl/container/btree_set.h>
#include <cstdint>
#include <ostream>
#include <fmt/core.h>
#include "schema/schema.hh"
class decorated_key_with_hash;
@@ -40,4 +41,8 @@ public:
repair_hash do_hash_for_mf(const decorated_key_with_hash& dk_with_hash, const mutation_fragment& mf);
};
template <> struct fmt::formatter<repair_hash> : fmt::formatter<std::string_view> {
auto format(const repair_hash& x, fmt::format_context& ctx) const {
return fmt::format_to(ctx.out(), "{}", x.hash);
}
};