From d6462bae7b228fbc0a0f764f2fb805c6d356c21b Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Mon, 24 Jan 2022 11:55:26 +1100 Subject: [PATCH] Refactor usage of + As we do for logical operators; put the `+` operator at the start of the line to make it more obvious and assist devs reading the code. --- src/network/address.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/network/address.rs b/src/network/address.rs index 39e30ab3..42f2dc8a 100644 --- a/src/network/address.rs +++ b/src/network/address.rs @@ -146,12 +146,11 @@ pub enum AddrV2 { impl Encodable for AddrV2 { fn consensus_encode(&self, e: W) -> Result { fn encode_addr(mut e: W, network: u8, bytes: &[u8]) -> Result { - let len = - network.consensus_encode(&mut e)? + - VarInt(bytes.len() as u64).consensus_encode(&mut e)? + - bytes.len(); - e.emit_slice(bytes)?; - Ok(len) + let len = network.consensus_encode(&mut e)? + + VarInt(bytes.len() as u64).consensus_encode(&mut e)? + + bytes.len(); + e.emit_slice(bytes)?; + Ok(len) } Ok(match *self { AddrV2::Ipv4(ref addr) => encode_addr(e, 1, &addr.octets())?,