Repository: rust-bitcoin/rust-bitcoin (language: rust)

Issue:
Be uniform in usage of either `IO` or `I/O` in rustdocs
We have both, we should pick one and be uniform. At least in the `io` crate if not everywhere.


Discussion / hints:
I prefer `I/O` since it will be mostly "prose" text in docs and not "code" text.
We cannot do `I/O` in "code" text since `/` is a reserved character, hence why `IO` is used in "code" text. 

Fix patch:
diff --git a/bitcoin/src/bip158.rs b/bitcoin/src/bip158.rs
index 893376703..419514abf 100644
--- a/bitcoin/src/bip158.rs
+++ b/bitcoin/src/bip158.rs
@@ -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),
         }
     }
 }
diff --git a/bitcoin/src/consensus/error.rs b/bitcoin/src/consensus/error.rs
index 500e9ecef..0864d7779 100644
--- a/bitcoin/src/consensus/error.rs
+++ b/bitcoin/src/consensus/error.rs
@@ -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),
         }
     }
diff --git a/bitcoin/src/consensus/mod.rs b/bitcoin/src/consensus/mod.rs
index 708ff6347..ecf4b6fdb 100644
--- a/bitcoin/src/consensus/mod.rs
+++ b/bitcoin/src/consensus/mod.rs
@@ -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),
         }
     }
 }
diff --git a/bitcoin/src/consensus/serde.rs b/bitcoin/src/consensus/serde.rs
index 8db3989b2..a182e8640 100644
--- a/bitcoin/src/consensus/serde.rs
+++ b/bitcoin/src/consensus/serde.rs
@@ -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
diff --git a/bitcoin/src/crypto/sighash.rs b/bitcoin/src/crypto/sighash.rs
index 22999fd1a..2b7941150 100644
--- a/bitcoin/src/crypto/sighash.rs
+++ b/bitcoin/src/crypto/sighash.rs
@@ -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,
diff --git a/io/README.md b/io/README.md
index f276437bc..3d5508de3 100644
--- a/io/README.md
+++ b/io/README.md
@@ -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
diff --git a/io/src/bridge.rs b/io/src/bridge.rs
index 471a6aba0..4079d57fd 100644
--- a/io/src/bridge.rs
+++ b/io/src/bridge.rs
@@ -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> {
diff --git a/io/src/lib.rs b/io/src/lib.rs
index c8d846dd5..fcaf1aa39 100644
--- a/io/src/lib.rs
+++ b/io/src/lib.rs
@@ -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")]


Test patch: