Change all occurrences of "IO" to "I/O"
This commit is contained in:
parent
75c8ec4595
commit
316d8bcb01
|
@ -76,7 +76,7 @@ impl_hashencode!(FilterHeader);
|
|||
pub enum Error {
|
||||
/// Missing UTXO, cannot calculate script filter.
|
||||
UtxoMissing(OutPoint),
|
||||
/// IO error reading or writing binary serialization of the filter.
|
||||
/// I/O error reading or writing binary serialization of the filter.
|
||||
Io(io::Error),
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ impl fmt::Display for Error {
|
|||
|
||||
match *self {
|
||||
UtxoMissing(ref coin) => write!(f, "unresolved UTXO {}", coin),
|
||||
Io(ref e) => write_err!(f, "IO error"; e),
|
||||
Io(ref e) => write_err!(f, "I/O error"; e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ impl fmt::Display for Error {
|
|||
use Error::*;
|
||||
|
||||
match *self {
|
||||
Io(ref e) => write_err!(f, "IO error"; e),
|
||||
Io(ref e) => write_err!(f, "I/O error"; e),
|
||||
Parse(ref e) => write_err!(f, "error parsing encoded object"; e),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ impl<E: fmt::Debug, I: Iterator<Item = Result<u8, E>>> IterReader<E, I> {
|
|||
|
||||
(Err(consensus::encode::Error::Io(io_error)), Some(de_error)) if io_error.kind() == io::ErrorKind::Other && io_error.get_ref().is_none() => Err(DecodeError::Other(de_error)),
|
||||
(Err(consensus::encode::Error::Parse(parse_error)), None) => Err(DecodeError::Parse(parse_error)),
|
||||
(Err(consensus::encode::Error::Io(io_error)), de_error) => panic!("unexpected IO error {:?} returned from {}::consensus_decode(), deserialization error: {:?}", io_error, core::any::type_name::<T>(), de_error),
|
||||
(Err(consensus_error), Some(de_error)) => panic!("{} should've returned `Other` IO error because of deserialization error {:?} but it returned consensus error {:?} instead", core::any::type_name::<T>(), de_error, consensus_error),
|
||||
(Err(consensus::encode::Error::Io(io_error)), de_error) => panic!("unexpected I/O error {:?} returned from {}::consensus_decode(), deserialization error: {:?}", io_error, core::any::type_name::<T>(), de_error),
|
||||
(Err(consensus_error), Some(de_error)) => panic!("{} should've returned `Other` I/O error because of deserialization error {:?} but it returned consensus error {:?} instead", core::any::type_name::<T>(), de_error, consensus_error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -443,12 +443,12 @@ impl<E> With<E> {
|
|||
match (result, writer.error) {
|
||||
(Ok(_), None) => writer.serializer.end(),
|
||||
(Ok(_), Some(error)) =>
|
||||
panic!("{} silently ate an IO error: {:?}", core::any::type_name::<T>(), error),
|
||||
panic!("{} silently ate an I/O error: {:?}", core::any::type_name::<T>(), error),
|
||||
(Err(io_error), Some(ser_error))
|
||||
if io_error.kind() == io::ErrorKind::Other && io_error.get_ref().is_none() =>
|
||||
Err(ser_error),
|
||||
(Err(io_error), ser_error) => panic!(
|
||||
"{} returned an unexpected IO error: {:?} serialization error: {:?}",
|
||||
"{} returned an unexpected I/O error: {:?} serialization error: {:?}",
|
||||
core::any::type_name::<T>(),
|
||||
io_error,
|
||||
ser_error
|
||||
|
|
|
@ -1452,9 +1452,9 @@ impl<E> From<Infallible> for SigningDataError<E> {
|
|||
}
|
||||
|
||||
impl<E> SigningDataError<E> {
|
||||
/// Returns the sighash variant, panicking if it's IO.
|
||||
/// Returns the sighash variant, panicking if it's I/O.
|
||||
///
|
||||
/// This is used when encoding to hash engine when we know that IO doesn't fail.
|
||||
/// This is used when encoding to hash engine when we know that I/O doesn't fail.
|
||||
fn unwrap_sighash(self) -> E {
|
||||
match self {
|
||||
Self::Sighash(error) => error,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Rust-Bitcoin IO Library
|
||||
# Rust-Bitcoin I/O Library
|
||||
|
||||
The `std::io` module is not exposed in `no-std` Rust so building `no-std` applications which require
|
||||
reading and writing objects via standard traits is not generally possible. Thus, this library exists
|
||||
|
|
|
@ -3,24 +3,24 @@ use alloc::boxed::Box;
|
|||
|
||||
use internals::rust_version;
|
||||
|
||||
/// A bridging wrapper providing the IO traits for types that already implement `std` IO traits.
|
||||
/// A bridging wrapper providing the I/O traits for types that already implement `std` I/O traits.
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug)]
|
||||
pub struct FromStd<T>(T);
|
||||
|
||||
impl<T> FromStd<T> {
|
||||
/// Wraps an IO type.
|
||||
/// Wraps an I/O type.
|
||||
#[inline]
|
||||
pub const fn new(inner: T) -> Self { Self(inner) }
|
||||
|
||||
/// Wraps a mutable reference to IO type.
|
||||
/// Wraps a mutable reference to I/O type.
|
||||
#[inline]
|
||||
pub fn new_mut(inner: &mut T) -> &mut Self {
|
||||
// SAFETY: the type is repr(transparent) and the lifetimes match
|
||||
unsafe { &mut *(inner as *mut _ as *mut Self) }
|
||||
}
|
||||
|
||||
/// Wraps a boxed IO type.
|
||||
/// Wraps a boxed I/O type.
|
||||
#[cfg(feature = "alloc")]
|
||||
#[inline]
|
||||
pub fn new_boxed(inner: Box<T>) -> Box<Self> {
|
||||
|
@ -121,18 +121,18 @@ impl<T: std::io::Write> std::io::Write for FromStd<T> {
|
|||
pub struct ToStd<T>(T);
|
||||
|
||||
impl<T> ToStd<T> {
|
||||
/// Wraps an IO type.
|
||||
/// Wraps an I/O type.
|
||||
#[inline]
|
||||
pub const fn new(inner: T) -> Self { Self(inner) }
|
||||
|
||||
/// Wraps a mutable reference to IO type.
|
||||
/// Wraps a mutable reference to I/O type.
|
||||
#[inline]
|
||||
pub fn new_mut(inner: &mut T) -> &mut Self {
|
||||
// SAFETY: the type is repr(transparent) and the lifetimes match
|
||||
unsafe { &mut *(inner as *mut _ as *mut Self) }
|
||||
}
|
||||
|
||||
/// Wraps a boxed IO type.
|
||||
/// Wraps a boxed I/O type.
|
||||
#[cfg(feature = "alloc")]
|
||||
#[inline]
|
||||
pub fn new_boxed(inner: Box<T>) -> Box<Self> {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! Rust-Bitcoin IO Library
|
||||
//! Rust-Bitcoin I/O Library
|
||||
//!
|
||||
//! The `std::io` module is not exposed in `no-std` Rust so building `no-std` applications which
|
||||
//! require reading and writing objects via standard traits is not generally possible. Thus, this
|
||||
|
@ -349,14 +349,14 @@ impl Write for Sink {
|
|||
#[inline]
|
||||
pub fn sink() -> Sink { Sink }
|
||||
|
||||
/// Wraps a `std` IO type to implement the traits from this crate.
|
||||
/// Wraps a `std` I/O type to implement the traits from this crate.
|
||||
///
|
||||
/// All methods are passed through converting the errors.
|
||||
#[cfg(feature = "std")]
|
||||
#[inline]
|
||||
pub const fn from_std<T>(std_io: T) -> FromStd<T> { FromStd::new(std_io) }
|
||||
|
||||
/// Wraps a mutable reference to `std` IO type to implement the traits from this crate.
|
||||
/// Wraps a mutable reference to `std` I/O type to implement the traits from this crate.
|
||||
///
|
||||
/// All methods are passed through converting the errors.
|
||||
#[cfg(feature = "std")]
|
||||
|
|
Loading…
Reference in New Issue