Skip to content

Commit

Permalink
feat: Relax Message Debug trait bound
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Sep 4, 2024
1 parent 96c40d7 commit 28e633b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions prost/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/generic_derive.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub trait CustomType: prost::Message + Default {}
pub trait CustomType: prost::Message + Default + core::fmt::Debug {}

impl CustomType for u64 {}

Expand Down
4 changes: 3 additions & 1 deletion tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -250,7 +252,7 @@ where
/// Generic roundtrip serialization check for messages.
pub fn check_message<M>(msg: &M)
where
M: Message + Default + PartialEq,
M: Debug + Message + Default + PartialEq,
{
let expected_len = msg.encoded_len();

Expand Down

0 comments on commit 28e633b

Please sign in to comment.