Merge rust-bitcoin/rust-bitcoin#2246: Automated nightly rustfmt (2023-12-03)

b7604dd768 2023-12-03 automated rustfmt nightly (apoelstra)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK b7604dd768

Tree-SHA512: 4790ee6088a9fe40103a3824a841a2219354a20e002715d9f21796d5943324b6b3e1f39e7f1356496718cbad1f822dfdde19f4d767473acf32dfe12ddb214ae6
This commit is contained in:
Andrew Poelstra 2023-12-03 17:10:54 +00:00
commit 69d0fc7064
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 4 additions and 10 deletions

View File

@ -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};

View File

@ -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::{

View File

@ -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<T: AsRef<[u8]>> Read for Cursor<T> {
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 }