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: ACKb7604dd768
Tree-SHA512: 4790ee6088a9fe40103a3824a841a2219354a20e002715d9f21796d5943324b6b3e1f39e7f1356496718cbad1f822dfdde19f4d767473acf32dfe12ddb214ae6
This commit is contained in:
commit
69d0fc7064
|
@ -643,9 +643,8 @@ mod tests {
|
||||||
|
|
||||||
#[cfg(bench)]
|
#[cfg(bench)]
|
||||||
mod benches {
|
mod benches {
|
||||||
use test::{black_box, Bencher};
|
|
||||||
|
|
||||||
use io::sink;
|
use io::sink;
|
||||||
|
use test::{black_box, Bencher};
|
||||||
|
|
||||||
use super::Block;
|
use super::Block;
|
||||||
use crate::consensus::{deserialize, Decodable, Encodable};
|
use crate::consensus::{deserialize, Decodable, Encodable};
|
||||||
|
|
|
@ -116,7 +116,6 @@ pub mod sign_message;
|
||||||
pub mod string;
|
pub mod string;
|
||||||
pub mod taproot;
|
pub mod taproot;
|
||||||
|
|
||||||
|
|
||||||
#[rustfmt::skip] // Keep public re-exports separate.
|
#[rustfmt::skip] // Keep public re-exports separate.
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use crate::{
|
pub use crate::{
|
||||||
|
|
|
@ -115,9 +115,7 @@ impl Error {
|
||||||
self.error.as_deref()
|
self.error.as_deref()
|
||||||
}
|
}
|
||||||
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
||||||
pub fn get_ref(&self) -> Option<&(dyn Debug + Send + Sync + 'static)> {
|
pub fn get_ref(&self) -> Option<&(dyn Debug + Send + Sync + 'static)> { self.error.as_deref() }
|
||||||
self.error.as_deref()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[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 start_pos = self.pos.try_into().unwrap_or(inner.len());
|
||||||
let read = core::cmp::min(inner.len().saturating_sub(start_pos), buf.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]);
|
buf[..read].copy_from_slice(&inner[start_pos..start_pos + read]);
|
||||||
self.pos = self
|
self.pos =
|
||||||
.pos
|
self.pos.saturating_add(read.try_into().unwrap_or(u64::max_value() /* unreachable */));
|
||||||
.saturating_add(read.try_into().unwrap_or(u64::max_value() /* unreachable */));
|
|
||||||
Ok(read)
|
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.
|
/// Returns a sink to which all writes succeed. See [`std::io::sink`] for more info.
|
||||||
pub fn sink() -> Sink { Sink }
|
pub fn sink() -> Sink { Sink }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue