From 61c652bf6f44bba45c370ceecdaaae1de8d37177 Mon Sep 17 00:00:00 2001 From: anakinxc <103552181+anakinxc@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:27:23 +0800 Subject: [PATCH] repo-sync-2023-08-04T17:42:59+0800 (#105) --- yacl/crypto/base/ecc/ec_point.h | 7 ++----- yacl/link/transport/channel_chunked_base.cc | 9 ++------- yacl/math/mpint/mp_int.h | 7 ++----- 3 files changed, 6 insertions(+), 17 deletions(-) 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