Skip to content

Commit

Permalink
elliptic-curve: leverage core::error::Error (#1702)
Browse files Browse the repository at this point in the history
This trait is now stable in `core`
  • Loading branch information
tarcieri authored Oct 21, 2024
1 parent 8a27953 commit 326b606
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions elliptic-curve/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub type Result<T> = core::result::Result<T, Error>;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Error;

impl core::error::Error for Error {}

impl Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("crypto error")
Expand Down Expand Up @@ -40,6 +42,3 @@ impl From<sec1::Error> for Error {
Error
}
}

#[cfg(feature = "std")]
impl std::error::Error for Error {}
2 changes: 2 additions & 0 deletions elliptic-curve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
clippy::mod_module_files,
clippy::panic,
clippy::panic_in_result_fn,
clippy::std_instead_of_alloc,
clippy::std_instead_of_core,
clippy::unwrap_used,
missing_debug_implementations,
missing_docs,
Expand Down

0 comments on commit 326b606

Please sign in to comment.