From: Elias Rohrer Date: Wed, 18 Sep 2024 07:39:30 +0000 (+0200) Subject: `rustfmt`: Run on `util/byte_utils.rs` X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=8e506301cabe85297bc3e072c3d962c4d5c11e43;p=rust-lightning `rustfmt`: Run on `util/byte_utils.rs` --- diff --git a/lightning/src/util/byte_utils.rs b/lightning/src/util/byte_utils.rs index 419a6b73a..9e023ffeb 100644 --- a/lightning/src/util/byte_utils.rs +++ b/lightning/src/util/byte_utils.rs @@ -9,23 +9,23 @@ #[inline] pub fn slice_to_be48(v: &[u8]) -> u64 { - ((v[0] as u64) << 8*5) | - ((v[1] as u64) << 8*4) | - ((v[2] as u64) << 8*3) | - ((v[3] as u64) << 8*2) | - ((v[4] as u64) << 8*1) | - ((v[5] as u64) << 8*0) + ((v[0] as u64) << 8 * 5) + | ((v[1] as u64) << 8 * 4) + | ((v[2] as u64) << 8 * 3) + | ((v[3] as u64) << 8 * 2) + | ((v[4] as u64) << 8 * 1) + | ((v[5] as u64) << 8 * 0) } #[inline] pub fn be48_to_array(u: u64) -> [u8; 6] { assert!(u & 0xffff_0000_0000_0000 == 0); let mut v = [0; 6]; - v[0] = ((u >> 8*5) & 0xff) as u8; - v[1] = ((u >> 8*4) & 0xff) as u8; - v[2] = ((u >> 8*3) & 0xff) as u8; - v[3] = ((u >> 8*2) & 0xff) as u8; - v[4] = ((u >> 8*1) & 0xff) as u8; - v[5] = ((u >> 8*0) & 0xff) as u8; + v[0] = ((u >> 8 * 5) & 0xff) as u8; + v[1] = ((u >> 8 * 4) & 0xff) as u8; + v[2] = ((u >> 8 * 3) & 0xff) as u8; + v[3] = ((u >> 8 * 2) & 0xff) as u8; + v[4] = ((u >> 8 * 1) & 0xff) as u8; + v[5] = ((u >> 8 * 0) & 0xff) as u8; v }