Skip to content

Commit

Permalink
base64ct: use core::error::Error (#1681)
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo authored Feb 25, 2025
1 parent f0c4daf commit 433c010
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions base64ct/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ impl fmt::Display for InvalidLengthError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for InvalidLengthError {}
impl core::error::Error for InvalidLengthError {}

/// Invalid encoding of provided Base64 string.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
Expand All @@ -28,8 +27,7 @@ impl fmt::Display for InvalidEncodingError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for InvalidEncodingError {}
impl core::error::Error for InvalidEncodingError {}

/// Generic error, union of [`InvalidLengthError`] and [`InvalidEncodingError`].
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -80,5 +78,4 @@ impl From<Error> for std::io::Error {
}
}

#[cfg(feature = "std")]
impl std::error::Error for Error {}
impl core::error::Error for Error {}

0 comments on commit 433c010

Please sign in to comment.