diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index 99d539e80..7d0be19a2 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -32,8 +32,8 @@ use core::fmt; use core::marker::PhantomData; use core::str::FromStr; -use bech32::primitives::hrp::Hrp; use bech32::primitives::gf32::Fe32; +use bech32::primitives::hrp::Hrp; use hashes::{sha256, HashEngine}; use secp256k1::{Secp256k1, Verification, XOnlyPublicKey}; diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index 1130c2955..13add078d 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -5,9 +5,8 @@ //! Provides the [`Work`] and [`Target`] types that are used in proof-of-work calculations. The //! functions here are designed to be fast, by that we mean it is safe to use them to check headers. -use core::cmp; -use core::fmt; use core::ops::{Add, Div, Mul, Not, Rem, Shl, Shr, Sub}; +use core::{cmp, fmt}; use io::{BufRead, Write}; #[cfg(all(test, mutate))] diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index 7830d1558..d54ccd564 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -133,41 +133,33 @@ pub use self::{ hmac::{Hmac, HmacEngine}, }; -/// SHA-1: Alias for the [`sha1::Hash`] hash type. -#[doc(inline)] -pub use sha1::Hash as Sha1; - -/// SHA-256: Alias for the [`sha256::Hash`] hash type. -#[doc(inline)] -pub use sha256::Hash as Sha256; - -/// SHA-384: Alias for the [`sha384::Hash`] hash type. -#[doc(inline)] -pub use sha384::Hash as Sha384; - -/// SHA-512: Alias for the [`sha512::Hash`] hash type. -#[doc(inline)] -pub use sha512::Hash as Sha512; - -/// SHA-512-256: Alias for the [`sha512_256::Hash`] hash type. -#[doc(inline)] -pub use sha512_256::Hash as Sha512_256; - -/// RIPEMD-160: Alias for the [`ripemd160::Hash`] hash type. -#[doc(inline)] -pub use ripemd160::Hash as Ripemd160; - -/// SipHash-2-4: Alias for the [`siphash24::Hash`] hash type. -#[doc(inline)] -pub use siphash24::Hash as Siphash24; - /// HASH-160: Alias for the [`hash160::Hash`] hash type. #[doc(inline)] pub use hash160::Hash as Hash160; - +/// RIPEMD-160: Alias for the [`ripemd160::Hash`] hash type. +#[doc(inline)] +pub use ripemd160::Hash as Ripemd160; +/// SHA-1: Alias for the [`sha1::Hash`] hash type. +#[doc(inline)] +pub use sha1::Hash as Sha1; +/// SHA-256: Alias for the [`sha256::Hash`] hash type. +#[doc(inline)] +pub use sha256::Hash as Sha256; /// Double SHA-256: Alias for the [`sha256d::Hash`] hash type. #[doc(inline)] pub use sha256d::Hash as Sha256d; +/// SHA-384: Alias for the [`sha384::Hash`] hash type. +#[doc(inline)] +pub use sha384::Hash as Sha384; +/// SHA-512: Alias for the [`sha512::Hash`] hash type. +#[doc(inline)] +pub use sha512::Hash as Sha512; +/// SHA-512-256: Alias for the [`sha512_256::Hash`] hash type. +#[doc(inline)] +pub use sha512_256::Hash as Sha512_256; +/// SipHash-2-4: Alias for the [`siphash24::Hash`] hash type. +#[doc(inline)] +pub use siphash24::Hash as Siphash24; /// Tagged SHA-256: Type alias for the [`sha256t::Hash`] hash type. pub type Sha256t = sha256t::Hash; diff --git a/io/src/error.rs b/io/src/error.rs index ffa8a5c0f..e88d6f4ff 100644 --- a/io/src/error.rs +++ b/io/src/error.rs @@ -40,7 +40,9 @@ impl Error { /// Returns a reference to this error. #[cfg(all(feature = "alloc", not(feature = "std")))] - pub fn get_ref(&self) -> Option<&(dyn fmt::Debug + Send + Sync + 'static)> { self.error.as_deref() } + pub fn get_ref(&self) -> Option<&(dyn fmt::Debug + Send + Sync + 'static)> { + self.error.as_deref() + } } impl From for Error { @@ -196,7 +198,9 @@ mod sealed { } impl IntoBoxDynDebug for &str { - fn into(self) -> Box { Box::new(String::from(self)) } + fn into(self) -> Box { + Box::new(String::from(self)) + } } impl IntoBoxDynDebug for String { diff --git a/units/src/amount.rs b/units/src/amount.rs index 2b9cf97b8..b3caa6c16 100644 --- a/units/src/amount.rs +++ b/units/src/amount.rs @@ -98,8 +98,7 @@ impl Denomination { /// These form are ambigous and could have many meanings. For example, M could denote Mega or Milli. /// If any of these forms are used, an error type PossiblyConfusingDenomination is returned. -const CONFUSING_FORMS: [&str; 6] = - ["MBTC", "Mbtc", "CBTC", "Cbtc", "UBTC", "Ubtc"]; +const CONFUSING_FORMS: [&str; 6] = ["MBTC", "Mbtc", "CBTC", "Cbtc", "UBTC", "Ubtc"]; impl fmt::Display for Denomination { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(self.as_str()) } @@ -2611,7 +2610,6 @@ mod tests { sa_str(&sa_sat(i64::MIN).to_string_in(D::Satoshi), D::MicroBitcoin), Err(OutOfRangeError::too_small().into()) ); - } #[cfg(feature = "alloc")]