Open tottoto opened 2 months ago
Can you explain why this is useful?
When the Debug
implementation is not needed, we can use prost_build::Config::skip_debug()
to skip implementing Debug
. However as the Messages
trait requires Debug
implementation, it is needed to implement dummy implementation to implement Message
when it is not actually needed. Relaxing Message
's Debug trait bound requirement removes this.
Is this an API breaking change?
I think this is a breaking change. Previously, when a value's type had a Message
bound imposed on it, we could write code that relied on that value implementing Debug
, after this change, we will get a compilation error and will need to explicitly state Debug
.
Can you explain why this is useful?
When the
Debug
implementation is not needed, we can useprost_build::Config::skip_debug()
to skip implementingDebug
. However as theMessages
trait requiresDebug
implementation, it is needed to implement dummy implementation to implementMessage
when it is not actually needed. RelaxingMessage
's Debug trait bound requirement removes this.
I see, so skip_debug
was already useful to write your own impl Debug
. With this change you can use skip_debug
to not implement Debug
at all. That makes sense.
Is this an API breaking change?
I think this is a breaking change. Previously, when a value's type had a
Message
bound imposed on it, we could write code that relied on that value implementingDebug
, after this change, we will get a compilation error and will need to explicitly stateDebug
.
I understand. I will prepare this for the next breaking release
Relaxes
Message
'sDebug
trait bound.BREAKING CHANGE:
trait Debug
was a supertrait oftrait Message
. This is no longer required byprost
. If your code relies ontrait Debug
being implemented for everyimpl Message
, you must now explicitly state that you require both Debug and Message. For example:where M: Debug + Message