From b7604dd768b70f901dc1d461795f7ba4acdd3b50 Mon Sep 17 00:00:00 2001 From: apoelstra Date: Sun, 3 Dec 2023 00:58:10 +0000 Subject: [PATCH] 2023-12-03 automated rustfmt nightly --- bitcoin/src/blockdata/block.rs | 3 +-- bitcoin/src/lib.rs | 1 - io/src/lib.rs | 10 +++------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index 56649276..18135412 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -643,9 +643,8 @@ mod tests { #[cfg(bench)] mod benches { - use test::{black_box, Bencher}; - use io::sink; + use test::{black_box, Bencher}; use super::Block; use crate::consensus::{deserialize, Decodable, Encodable}; diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index 36fe3ee7..38d77248 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -116,7 +116,6 @@ pub mod sign_message; pub mod string; pub mod taproot; - #[rustfmt::skip] // Keep public re-exports separate. #[doc(inline)] pub use crate::{ diff --git a/io/src/lib.rs b/io/src/lib.rs index 2d14fb0d..7a84eb0a 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -115,9 +115,7 @@ impl Error { self.error.as_deref() } #[cfg(all(feature = "alloc", not(feature = "std")))] - pub fn get_ref(&self) -> Option<&(dyn Debug + Send + Sync + 'static)> { - self.error.as_deref() - } + pub fn get_ref(&self) -> Option<&(dyn Debug + Send + Sync + 'static)> { self.error.as_deref() } } #[cfg(feature = "std")] @@ -268,9 +266,8 @@ impl> Read for Cursor { let start_pos = self.pos.try_into().unwrap_or(inner.len()); let read = core::cmp::min(inner.len().saturating_sub(start_pos), buf.len()); buf[..read].copy_from_slice(&inner[start_pos..start_pos + read]); - self.pos = self - .pos - .saturating_add(read.try_into().unwrap_or(u64::max_value() /* unreachable */)); + self.pos = + self.pos.saturating_add(read.try_into().unwrap_or(u64::max_value() /* unreachable */)); Ok(read) } } @@ -350,4 +347,3 @@ impl std::io::Write for Sink { } /// Returns a sink to which all writes succeed. See [`std::io::sink`] for more info. pub fn sink() -> Sink { Sink } -