From da7ffd4e73473eb366bee1ae7432bc3b5df123eb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 22 Feb 2024 11:47:43 +0800 Subject: [PATCH] tools/scylla-types: print using managed_bytes instead of materializing the `managed_bytes_view` to a string, and print it, print it directly to stdout. this change helps to deprecate `to_hex()` helpers, we should materialize string only when necessary. Signed-off-by: Kefu Chai Closes scylladb/scylladb#17463 --- tools/scylla-types.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/scylla-types.cc b/tools/scylla-types.cc index 4821ad2b87..d754a33027 100644 --- a/tools/scylla-types.cc +++ b/tools/scylla-types.cc @@ -15,6 +15,7 @@ #include "schema/schema_builder.hh" #include "tools/utils.hh" #include "dht/i_partitioner.hh" +#include "utils/managed_bytes.hh" using namespace seastar; using namespace tools::utils; @@ -68,7 +69,7 @@ struct serializing_visitor { }; void serialize_handler(type_variant type, std::vector values, const bpo::variables_map& vm) { - fmt::print("{}\n", to_hex(serializing_visitor{values}(type))); + fmt::print("{}\n", managed_bytes_view(serializing_visitor{values}(type))); } sstring to_printable_string(const data_type& type, bytes_view value) {