mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
mutation: add fmt::formatter for frozen_mutation::printer
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 frozen_mutation::printer, and drop its operator. Refs #13245 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
@@ -147,10 +147,6 @@ mutation_partition_view frozen_mutation::partition() const {
|
||||
return mutation_partition_view::from_view(mutation_view().partition());
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const frozen_mutation::printer& pr) {
|
||||
return out << pr.self.unfreeze(pr.schema);
|
||||
}
|
||||
|
||||
frozen_mutation::printer frozen_mutation::pretty_printer(schema_ptr s) const {
|
||||
return { *this, std::move(s) };
|
||||
}
|
||||
|
||||
@@ -222,7 +222,6 @@ public:
|
||||
struct printer {
|
||||
const frozen_mutation& self;
|
||||
schema_ptr schema;
|
||||
friend std::ostream& operator<<(std::ostream&, const printer&);
|
||||
};
|
||||
|
||||
// Same requirements about the schema as unfreeze().
|
||||
@@ -323,3 +322,9 @@ auto frozen_mutation::consume_gently(schema_ptr s, Consumer& consumer) const ->
|
||||
frozen_mutation_consumer_adaptor adaptor(s, consumer);
|
||||
co_return co_await consume_gently(s, adaptor);
|
||||
}
|
||||
|
||||
template <> struct fmt::formatter<frozen_mutation::printer> : fmt::formatter<std::string_view> {
|
||||
auto format(const frozen_mutation::printer& pr, fmt::format_context& ctx) const {
|
||||
return fmt::format_to(ctx.out(), "{}", pr.self.unfreeze(pr.schema));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user