Skip to content

Commit 28e633b

Browse files
committed
feat: Relax Message Debug trait bound
1 parent 96c40d7 commit 28e633b

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
@@ -144,6 +144,8 @@ pub mod default_string_escape {
144144
include!(concat!(env!("OUT_DIR"), "/default_string_escape.rs"));
145145
}
146146

147+
use core::fmt::Debug;
148+
147149
#[cfg(not(feature = "std"))]
148150
use alloc::vec::Vec;
149151

@@ -250,7 +252,7 @@ where
250252
/// Generic roundtrip serialization check for messages.
251253
pub fn check_message<M>(msg: &M)
252254
where
253-
M: Message + Default + PartialEq,
255+
M: Debug + Message + Default + PartialEq,
254256
{
255257
let expected_len = msg.encoded_len();
256258

0 commit comments

Comments
 (0)