Skip to content

Commit aad1803

Browse files
authored
Merge pull request #1092 from TheBlueMatt/2021-09-type-explicit-bounds
Move trait bounds on `wire::Type` from use to the trait itself
2 parents 34dd7c5 + 4c81318 commit aad1803

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/wire.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use util::ser::{Readable, Writeable, Writer};
2020
/// decoders.
2121
pub trait CustomMessageReader {
2222
/// The type of the message decoded by the implementation.
23-
type CustomMessage: core::fmt::Debug + Type + Writeable;
23+
type CustomMessage: Type;
2424
/// Decodes a custom message to `CustomMessageType`. If the given message type is known to the
2525
/// implementation and the message could be decoded, must return `Ok(Some(message))`. If the
2626
/// message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
@@ -245,12 +245,12 @@ pub(crate) use self::encode::Encode;
245245
/// Defines a type identifier for sending messages over the wire.
246246
///
247247
/// Messages implementing this trait specify a type and must be [`Writeable`].
248-
pub trait Type {
248+
pub trait Type: core::fmt::Debug + Writeable {
249249
/// Returns the type identifying the message payload.
250250
fn type_id(&self) -> u16;
251251
}
252252

253-
impl<T> Type for T where T: Encode {
253+
impl<T: core::fmt::Debug + Writeable> Type for T where T: Encode {
254254
fn type_id(&self) -> u16 {
255255
T::TYPE
256256
}

0 commit comments

Comments
 (0)