Change all occurrences of "IO" to "I/O"

This commit is contained in:
Jamil Lambert, PhD 2025-01-07 12:37:47 +00:00
parent 75c8ec4595
commit 316d8bcb01
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
8 changed files with 20 additions and 20 deletions

View File

@ -76,7 +76,7 @@ impl_hashencode!(FilterHeader);
pub enum Error { pub enum Error {
/// Missing UTXO, cannot calculate script filter. /// Missing UTXO, cannot calculate script filter.
UtxoMissing(OutPoint), 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), Io(io::Error),
} }
@ -90,7 +90,7 @@ impl fmt::Display for Error {
match *self { match *self {
UtxoMissing(ref coin) => write!(f, "unresolved UTXO {}", coin), 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),
} }
} }
} }

View File

@ -115,7 +115,7 @@ impl fmt::Display for Error {
use Error::*; use Error::*;
match *self { 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), Parse(ref e) => write_err!(f, "error parsing encoded object"; e),
} }
} }

View File

@ -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::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::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::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` IO error because of deserialization error {:?} but it returned consensus error {:?} instead", core::any::type_name::<T>(), de_error, consensus_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),
} }
} }
} }

View File

@ -443,12 +443,12 @@ impl<E> With<E> {
match (result, writer.error) { match (result, writer.error) {
(Ok(_), None) => writer.serializer.end(), (Ok(_), None) => writer.serializer.end(),
(Ok(_), Some(error)) => (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)) (Err(io_error), Some(ser_error))
if io_error.kind() == io::ErrorKind::Other && io_error.get_ref().is_none() => if io_error.kind() == io::ErrorKind::Other && io_error.get_ref().is_none() =>
Err(ser_error), Err(ser_error),
(Err(io_error), ser_error) => panic!( (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>(), core::any::type_name::<T>(),
io_error, io_error,
ser_error ser_error

View File

@ -1452,9 +1452,9 @@ impl<E> From<Infallible> for SigningDataError<E> {
} }
impl<E> 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 { fn unwrap_sighash(self) -> E {
match self { match self {
Self::Sighash(error) => error, Self::Sighash(error) => error,

View File

@ -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 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 reading and writing objects via standard traits is not generally possible. Thus, this library exists

View File

@ -3,24 +3,24 @@ use alloc::boxed::Box;
use internals::rust_version; 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)] #[repr(transparent)]
#[derive(Debug)] #[derive(Debug)]
pub struct FromStd<T>(T); pub struct FromStd<T>(T);
impl<T> FromStd<T> { impl<T> FromStd<T> {
/// Wraps an IO type. /// Wraps an I/O type.
#[inline] #[inline]
pub const fn new(inner: T) -> Self { Self(inner) } 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] #[inline]
pub fn new_mut(inner: &mut T) -> &mut Self { pub fn new_mut(inner: &mut T) -> &mut Self {
// SAFETY: the type is repr(transparent) and the lifetimes match // SAFETY: the type is repr(transparent) and the lifetimes match
unsafe { &mut *(inner as *mut _ as *mut Self) } unsafe { &mut *(inner as *mut _ as *mut Self) }
} }
/// Wraps a boxed IO type. /// Wraps a boxed I/O type.
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
#[inline] #[inline]
pub fn new_boxed(inner: Box<T>) -> Box<Self> { 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); pub struct ToStd<T>(T);
impl<T> ToStd<T> { impl<T> ToStd<T> {
/// Wraps an IO type. /// Wraps an I/O type.
#[inline] #[inline]
pub const fn new(inner: T) -> Self { Self(inner) } 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] #[inline]
pub fn new_mut(inner: &mut T) -> &mut Self { pub fn new_mut(inner: &mut T) -> &mut Self {
// SAFETY: the type is repr(transparent) and the lifetimes match // SAFETY: the type is repr(transparent) and the lifetimes match
unsafe { &mut *(inner as *mut _ as *mut Self) } unsafe { &mut *(inner as *mut _ as *mut Self) }
} }
/// Wraps a boxed IO type. /// Wraps a boxed I/O type.
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
#[inline] #[inline]
pub fn new_boxed(inner: Box<T>) -> Box<Self> { pub fn new_boxed(inner: Box<T>) -> Box<Self> {

View File

@ -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 //! 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 //! require reading and writing objects via standard traits is not generally possible. Thus, this
@ -349,14 +349,14 @@ impl Write for Sink {
#[inline] #[inline]
pub fn sink() -> Sink { Sink } 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. /// All methods are passed through converting the errors.
#[cfg(feature = "std")] #[cfg(feature = "std")]
#[inline] #[inline]
pub const fn from_std<T>(std_io: T) -> FromStd<T> { FromStd::new(std_io) } 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. /// All methods are passed through converting the errors.
#[cfg(feature = "std")] #[cfg(feature = "std")]