From 39ee8593cb288fa076e0ebc496cc6611265be285 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 9 Mar 2024 23:15:51 +0800 Subject: [PATCH] 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 --- repair/hash.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repair/hash.hh b/repair/hash.hh index 06a345402e..ad44184710 100644 --- a/repair/hash.hh +++ b/repair/hash.hh @@ -2,6 +2,7 @@ #include #include #include +#include #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 : fmt::formatter { + auto format(const repair_hash& x, fmt::format_context& ctx) const { + return fmt::format_to(ctx.out(), "{}", x.hash); + } +};