Skip to content

Commit e965caa

Browse files
committed
appease Rust 1.22 by using byte_utils and ref in match arms
1 parent 8873d3a commit e965caa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lightning/src/ln/peers/conduit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Conduit {
8484
let length_vec = chacha::decrypt(&self.receiving_key, self.receiving_nonce as u64, &[0; 0], encrypted_length).unwrap();
8585
let mut length_bytes = [0u8; 2];
8686
length_bytes.copy_from_slice(length_vec.as_slice());
87-
let message_length = u16::from_be_bytes(length_bytes) as usize;
87+
let message_length = byte_utils::slice_to_be16(&length_bytes) as usize;
8888

8989
let message_end_index = message_length + 18; // todo: abort if too short
9090
if buffer.len() < message_end_index {

lightning/src/ln/peers/handshake/acts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ impl Act {
2424
/// Convert any act into a byte vector
2525
pub fn serialize(&self) -> Vec<u8> {
2626
match &self {
27-
&Act::One(act) => {
27+
&Act::One(ref act) => {
2828
act.0.to_vec()
2929
}
30-
&Act::Two(act) => {
30+
&Act::Two(ref act) => {
3131
act.0.to_vec()
3232
}
33-
&Act::Three(act) => {
33+
&Act::Three(ref act) => {
3434
act.0.to_vec()
3535
}
3636
}

0 commit comments

Comments
 (0)