diff --git a/yacl/crypto/base/ecc/ec_point.h b/yacl/crypto/base/ecc/ec_point.h index 855d783..b99077d 100644 --- a/yacl/crypto/base/ecc/ec_point.h +++ b/yacl/crypto/base/ecc/ec_point.h @@ -87,9 +87,6 @@ using Array160 = // a black box using EcPoint = std::variant; -} // namespace yacl::crypto +inline auto format_as(const AffinePoint &ap) { return fmt::streamed(ap); } -namespace fmt { -template <> -struct formatter : ostream_formatter {}; -} // namespace fmt +} // namespace yacl::crypto diff --git a/yacl/link/transport/channel_chunked_base.cc b/yacl/link/transport/channel_chunked_base.cc index baa449a..cc9db03 100644 --- a/yacl/link/transport/channel_chunked_base.cc +++ b/yacl/link/transport/channel_chunked_base.cc @@ -32,11 +32,6 @@ DECLARE_int32(h2_client_stream_window_size); } -namespace fmt { -template <> -struct formatter : ostream_formatter {}; -} // namespace fmt - namespace yacl::link::transport { namespace ic = org::interconnection; @@ -250,8 +245,8 @@ void ChannelChunkedBase::OnRequest(const ic_pb::PushRequest* request, } else { response->mutable_header()->set_error_code(ic::ErrorCode::INVALID_REQUEST); response->mutable_header()->set_error_msg( - fmt::format("unrecongnized trans type={}, from rank={}", trans_type, - request->sender_rank())); + fmt::format("unrecongnized trans type={}, from rank={}", + TransType_Name(trans_type), request->sender_rank())); } } diff --git a/yacl/math/mpint/mp_int.h b/yacl/math/mpint/mp_int.h index 3243d6f..d1ca419 100644 --- a/yacl/math/mpint/mp_int.h +++ b/yacl/math/mpint/mp_int.h @@ -369,6 +369,8 @@ class MPInt { friend class MontgomerySpace; }; +inline auto format_as(const MPInt &i) { return fmt::streamed(i); } + } // namespace yacl::math yacl::math::MPInt operator""_mp(const char *sz, size_t n); @@ -400,8 +402,3 @@ MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS) { } // namespace adaptor } // MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS) } // namespace msgpack - -namespace fmt { -template <> -struct formatter : ostream_formatter {}; -} // namespace fmt