X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fwire.rs;h=532ebbf312511da55c6fc1f1c021b4d64d41d1e3;hb=8e7b5905fd84999318bdcf9cbcb9cfecbf58f532;hp=12e77d07f698f851b0430a638d8595c111fd0595;hpb=836985a5e5e8036d5dea47797ef6fba498616e67;p=rust-lightning diff --git a/lightning/src/ln/wire.rs b/lightning/src/ln/wire.rs index 12e77d07..532ebbf3 100644 --- a/lightning/src/ln/wire.rs +++ b/lightning/src/ln/wire.rs @@ -105,8 +105,8 @@ impl MessageType { } } -impl ::std::fmt::Display for MessageType { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { +impl ::core::fmt::Display for MessageType { + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{}", self.0) } } @@ -396,12 +396,12 @@ mod tests { #[test] fn read_unknown_message() { - let buffer = &byte_utils::be16_to_array(::std::u16::MAX); + let buffer = &byte_utils::be16_to_array(::core::u16::MAX); let mut reader = ::std::io::Cursor::new(buffer); let message = read(&mut reader).unwrap(); match message { - Message::Unknown(MessageType(::std::u16::MAX)) => (), - _ => panic!("Expected message type {}; found: {}", ::std::u16::MAX, message.type_id()), + Message::Unknown(MessageType(::core::u16::MAX)) => (), + _ => panic!("Expected message type {}; found: {}", ::core::u16::MAX, message.type_id()), } } @@ -411,7 +411,7 @@ mod tests { let mut buffer = Vec::new(); assert!(write(&message, &mut buffer).is_ok()); - let type_length = ::std::mem::size_of::(); + let type_length = ::core::mem::size_of::(); let (type_bytes, payload_bytes) = buffer.split_at(type_length); assert_eq!(byte_utils::slice_to_be16(type_bytes), msgs::Pong::TYPE); assert_eq!(payload_bytes, &ENCODED_PONG[type_length..]);