diff --git a/src/alphabet.rs b/src/alphabet.rs index 75a6139..09c38df 100644 --- a/src/alphabet.rs +++ b/src/alphabet.rs @@ -77,7 +77,7 @@ impl Alphabet { /// .into_string(); /// /// assert_eq!("#ERRN)N RD", encoded); - /// # Ok::<(), Box>(()) + /// # Ok::<(), Box>(()) /// ``` /// ## Errors /// @@ -140,7 +140,7 @@ impl Alphabet { /// .into_string(); /// /// assert_eq!("#ERRN)N RD", encoded); - /// # Ok::<(), Box>(()) + /// # Ok::<(), Box>(()) /// ``` /// /// If your alphabet is inconsistent then this will fail to compile in a `const` context: @@ -170,8 +170,7 @@ impl fmt::Debug for Alphabet { } } -#[cfg(feature = "std")] -impl std::error::Error for Error {} +impl core::error::Error for Error {} impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/decode.rs b/src/decode.rs index 9463bfd..4981e1e 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -351,7 +351,7 @@ impl<'a, I: AsRef<[u8]>> DecodeBuilder<'a, I> { /// For `const` compatibility we are restricted to using a concrete input and output type, as /// `const` trait implementations and `&mut` are unstable. These methods will eventually be /// deprecated once the primary interfaces can be converted into `const fn` directly. -impl<'a, 'b> DecodeBuilder<'a, &'b [u8]> { +impl DecodeBuilder<'_, &[u8]> { /// Decode into a new array. /// /// Returns the decoded array as bytes. @@ -603,8 +603,7 @@ const fn decode_into_const(input: &[u8], alpha: &Alphabet) -> Re Ok(output) } -#[cfg(feature = "std")] -impl std::error::Error for Error {} +impl core::error::Error for Error {} impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/encode.rs b/src/encode.rs index 94fca93..e647659 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -518,8 +518,7 @@ fn encode_cb58_into( ) } -#[cfg(feature = "std")] -impl std::error::Error for Error {} +impl core::error::Error for Error {} impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/lib.rs b/src/lib.rs index cbeee1c..15a3d25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,7 +74,7 @@ //! bs58::decode("he11owor1d").onto(&mut decoded)?; //! bs58::encode(decoded).onto(&mut encoded)?; //! assert_eq!("he11owor1d", encoded); -//! # Ok::<(), Box>(()) +//! # Ok::<(), Box>(()) //! ``` #[cfg(feature = "std")]