bitcoin: Remove the custom sink

We have a sink in the new `io` crate, use that one and remove the one in
`bitcoin::prelude`.
This commit is contained in:
Tobin C. Harding 2023-12-08 09:57:40 +11:00
parent b503aa1544
commit f06d12455f
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 0 additions and 25 deletions

View File

@ -140,27 +140,6 @@ pub use crate::{
taproot::{TapBranchTag, TapLeafHash, TapLeafTag, TapNodeHash, TapTweakHash, TapTweakTag}, taproot::{TapBranchTag, TapLeafHash, TapLeafTag, TapNodeHash, TapTweakHash, TapTweakTag},
}; };
#[cfg(not(feature = "std"))]
mod io_extras {
use crate::io::Write;
/// A writer which will move data into the void.
pub struct Sink {
_priv: (),
}
/// Creates an instance of a writer which will successfully consume all data.
pub const fn sink() -> Sink { Sink { _priv: () } }
impl Write for Sink {
#[inline]
fn write(&mut self, buf: &[u8]) -> io::Result<usize> { Ok(buf.len()) }
#[inline]
fn flush(&mut self) -> io::Result<()> { Ok(()) }
}
}
#[rustfmt::skip] #[rustfmt::skip]
mod prelude { mod prelude {
#[cfg(all(not(feature = "std"), not(test)))] #[cfg(all(not(feature = "std"), not(test)))]
@ -178,12 +157,8 @@ mod prelude {
#[cfg(any(feature = "std", test))] #[cfg(any(feature = "std", test))]
pub use std::collections::{BTreeMap, BTreeSet, btree_map, BinaryHeap}; pub use std::collections::{BTreeMap, BTreeSet, btree_map, BinaryHeap};
#[cfg(feature = "std")]
pub use crate::io::sink; pub use crate::io::sink;
#[cfg(not(feature = "std"))]
pub use crate::io_extras::sink;
pub use hex::DisplayHex; pub use hex::DisplayHex;
} }