mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
Remove optional failure dependency and impl std::error::Error.
This commit is contained in:
parent
1d8b3995c9
commit
c21224170a
2 changed files with 10 additions and 9 deletions
|
|
@ -11,12 +11,15 @@
|
|||
//!
|
||||
//! Currently, these are only used in the implementations of `TryFrom`.
|
||||
//!
|
||||
//! This module optionally implements support for the types in the `failure`
|
||||
//! crate. This can be enabled by building with `--features failure`.
|
||||
//! If used with `std` support, this public types in this module implement the
|
||||
//! `std::error::Error` trait.
|
||||
|
||||
use core::fmt;
|
||||
use core::fmt::Display;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use std::error::Error;
|
||||
|
||||
/// Internal errors. Most application-level developers will likely not
|
||||
/// need to pay any attention to these.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||
|
|
@ -41,8 +44,8 @@ impl Display for InternalError {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "failure")]
|
||||
impl ::failure::Fail for InternalError {}
|
||||
#[cfg(feature = "std")]
|
||||
impl Error for InternalError { }
|
||||
|
||||
/// Errors which may occur.
|
||||
///
|
||||
|
|
@ -58,9 +61,9 @@ impl Display for CurveError {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "failure")]
|
||||
impl ::failure::Fail for CurveError {
|
||||
fn cause(&self) -> Option<&dyn (::failure::Fail)> {
|
||||
#[cfg(feature = "std")]
|
||||
impl Error for CurveError {
|
||||
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||
Some(&self.0)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@ extern crate packed_simd;
|
|||
|
||||
extern crate byteorder;
|
||||
pub extern crate digest;
|
||||
#[cfg(feature = "failure")]
|
||||
extern crate failure;
|
||||
extern crate rand_core;
|
||||
#[cfg(test)]
|
||||
extern crate rand_os;
|
||||
|
|
|
|||
Loading…
Reference in a new issue