Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Relax Message Debug trait bound #1147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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