Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/alphabet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Alphabet {
/// .into_string();
///
/// assert_eq!("#ERRN)N RD", encoded);
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// # Ok::<(), Box<dyn core::error::Error>>(())
/// ```
/// ## Errors
///
Expand Down Expand Up @@ -140,7 +140,7 @@ impl Alphabet {
/// .into_string();
///
/// assert_eq!("#ERRN)N RD", encoded);
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// # Ok::<(), Box<dyn core::error::Error>>(())
/// ```
///
/// If your alphabet is inconsistent then this will fail to compile in a `const` context:
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -603,8 +603,7 @@ const fn decode_into_const<const N: usize>(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 {
Expand Down
3 changes: 1 addition & 2 deletions src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
//! bs58::decode("he11owor1d").onto(&mut decoded)?;
//! bs58::encode(decoded).onto(&mut encoded)?;
//! assert_eq!("he11owor1d", encoded);
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! # Ok::<(), Box<dyn core::error::Error>>(())
//! ```

#[cfg(feature = "std")]
Expand Down
Loading