Skip to content

Commit bb81b3c

Browse files
authored
feat: Relax Message Debug trait bound (#1147)
1 parent c7e9a00 commit bb81b3c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

prost/src/message.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use alloc::boxed::Box;
33
#[cfg(not(feature = "std"))]
44
use alloc::vec::Vec;
55

6-
use core::fmt::Debug;
7-
86
use bytes::{Buf, BufMut};
97

108
use crate::encoding::varint::{encode_varint, encoded_len_varint};
@@ -14,7 +12,7 @@ use crate::DecodeError;
1412
use crate::EncodeError;
1513

1614
/// A Protocol Buffers message.
17-
pub trait Message: Debug + Send + Sync {
15+
pub trait Message: Send + Sync {
1816
/// Encodes the message to a buffer.
1917
///
2018
/// This method will panic if the buffer has insufficient capacity.

tests/src/generic_derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub trait CustomType: prost::Message + Default {}
1+
pub trait CustomType: prost::Message + Default + core::fmt::Debug {}
22

33
impl CustomType for u64 {}
44

tests/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ pub mod proto3 {
118118
}
119119
}
120120

121+
use core::fmt::Debug;
122+
121123
#[cfg(not(feature = "std"))]
122124
use alloc::vec::Vec;
123125

@@ -224,7 +226,7 @@ where
224226
/// Generic roundtrip serialization check for messages.
225227
pub fn check_message<M>(msg: &M)
226228
where
227-
M: Message + Default + PartialEq,
229+
M: Debug + Message + Default + PartialEq,
228230
{
229231
let expected_len = msg.encoded_len();
230232

0 commit comments

Comments
 (0)