diff --git a/bitcoin/src/bip152.rs b/bitcoin/src/bip152.rs index fc328f108..5d5ef67d6 100644 --- a/bitcoin/src/bip152.rs +++ b/bitcoin/src/bip152.rs @@ -166,7 +166,7 @@ impl Decodable for HeaderAndShortIds { header: Decodable::consensus_decode(r)?, nonce: Decodable::consensus_decode(r)?, short_ids: Decodable::consensus_decode(r)?, - prefilled_txs: Decodable::consensus_decode(r)? + prefilled_txs: Decodable::consensus_decode(r)?, }; match header_short_ids.short_ids.len().checked_add(header_short_ids.prefilled_txs.len()) { Some(x) if x <= u16::MAX.into() => Ok(header_short_ids), @@ -244,8 +244,10 @@ impl HeaderAndShortIds { }); } else { match version { - 1 => short_ids.push(ShortId::with_siphash_keys(&tx.compute_txid(), siphash_keys)), - 2 => short_ids.push(ShortId::with_siphash_keys(&tx.compute_wtxid(), siphash_keys)), + 1 => + short_ids.push(ShortId::with_siphash_keys(&tx.compute_txid(), siphash_keys)), + 2 => short_ids + .push(ShortId::with_siphash_keys(&tx.compute_wtxid(), siphash_keys)), _ => unreachable!(), } } diff --git a/units/src/locktime/absolute.rs b/units/src/locktime/absolute.rs index e5d308625..320ab3087 100644 --- a/units/src/locktime/absolute.rs +++ b/units/src/locktime/absolute.rs @@ -3,7 +3,7 @@ //! Provides [`Height`] and [`Time`] types used by the `rust-bitcoin` `absolute::LockTime` type. #[cfg(feature = "alloc")] -use alloc::{string::String, boxed::Box}; +use alloc::{boxed::Box, string::String}; use core::fmt; use internals::write_err; @@ -372,10 +372,11 @@ impl From for ParseError { #[cfg(test)] mod tests { - use super::*; #[cfg(feature = "serde")] use internals::serde_round_trip; + use super::*; + #[test] fn time_from_str_hex_happy_path() { let actual = Time::from_hex("0x6289C350").unwrap();