diff --git a/concrete_types.hh b/concrete_types.hh index e75ca6d55c..e64467e9af 100644 --- a/concrete_types.hh +++ b/concrete_types.hh @@ -131,7 +131,6 @@ struct varint_type_impl final : public concrete_type struct inet_addr_type_impl final : public concrete_type { inet_addr_type_impl(); - static sstring to_sstring(const seastar::net::inet_address& addr); static seastar::net::inet_address from_sstring(sstring_view s); }; diff --git a/lang/lua.cc b/lang/lua.cc index a095ac6d15..7da7124f21 100644 --- a/lang/lua.cc +++ b/lang/lua.cc @@ -1030,7 +1030,7 @@ struct to_lua_visitor { void operator()(const inet_addr_type_impl& t, const emptyable* v) { // returns a string - sstring s = inet_addr_type_impl::to_sstring(v->get()); + sstring s = fmt::to_string(v->get()); push_sstring(l, s); } diff --git a/types/types.cc b/types/types.cc index 440248e7c3..ec5b155a1f 100644 --- a/types/types.cc +++ b/types/types.cc @@ -115,12 +115,6 @@ sstring boolean_to_string(const bool b) { return b ? "true" : "false"; } -sstring inet_addr_type_impl::to_sstring(const seastar::net::inet_address& addr) { - std::ostringstream out; - out << addr; - return out.str(); -} - static const char* byte_type_name = "org.apache.cassandra.db.marshal.ByteType"; static const char* short_type_name = "org.apache.cassandra.db.marshal.ShortType"; static const char* int32_type_name = "org.apache.cassandra.db.marshal.Int32Type"; @@ -2882,7 +2876,7 @@ struct to_string_impl_visitor { } sstring operator()(const empty_type_impl&, const void*) { return sstring(); } sstring operator()(const inet_addr_type_impl& a, const inet_addr_type_impl::native_type* v) { - return format_if_not_empty(a, v, inet_addr_type_impl::to_sstring); + return format_if_not_empty(a, v, [] (const seastar::net::inet_address& addr) { return fmt::to_string(addr); }); } sstring operator()(const list_type_impl& l, const list_type_impl::native_type* v) { return format_if_not_empty(