From 6bac6c3cb6d64af58e5adbf7346fc94cbf2b0d04 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 4 Sep 2024 10:18:08 +0900 Subject: [PATCH] feat: Relax Message Debug trait bound --- prost/src/message.rs | 4 +--- tests/src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prost/src/message.rs b/prost/src/message.rs index ee33eecd9..2d91ede3c 100644 --- a/prost/src/message.rs +++ b/prost/src/message.rs @@ -3,8 +3,6 @@ use alloc::boxed::Box; #[cfg(not(feature = "std"))] use alloc::vec::Vec; -use core::fmt::Debug; - use bytes::{Buf, BufMut}; use crate::encoding::varint::{encode_varint, encoded_len_varint}; @@ -14,7 +12,7 @@ use crate::DecodeError; use crate::EncodeError; /// A Protocol Buffers message. -pub trait Message: Debug + Send + Sync { +pub trait Message: Send + Sync { /// Encodes the message to a buffer. /// /// This method will panic if the buffer has insufficient capacity. diff --git a/tests/src/lib.rs b/tests/src/lib.rs index bdeb90352..a54607f54 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -144,6 +144,8 @@ pub mod default_string_escape { include!(concat!(env!("OUT_DIR"), "/default_string_escape.rs")); } +use core::fmt::Debug; + #[cfg(not(feature = "std"))] use alloc::vec::Vec; @@ -250,7 +252,7 @@ where /// Generic roundtrip serialization check for messages. pub fn check_message(msg: &M) where - M: Message + Default + PartialEq, + M: Debug + Message + Default + PartialEq, { let expected_len = msg.encoded_len();