summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/error.rs b/src/error.rs
index 9cdb932..1b36975 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -19,7 +19,7 @@ pub enum Error {
/// A library usage error.
LibraryError(LibraryError),
/// An error that occured during random number generation.
- RandError(rand_core::Error),
+ RandError(Box<dyn error::Error>),
/// An error that is caused by an unexpected value returned by libnitrokey.
UnexpectedError,
/// An unknown error returned by libnitrokey.
@@ -60,12 +60,6 @@ impl From<LibraryError> for Error {
}
}
-impl From<rand_core::Error> for Error {
- fn from(error: rand_core::Error) -> Self {
- Error::RandError(error)
- }
-}
-
impl From<str::Utf8Error> for Error {
fn from(error: str::Utf8Error) -> Self {
Error::Utf8Error(error)
@@ -84,7 +78,7 @@ impl error::Error for Error {
Error::CommandError(ref err) => Some(err),
Error::CommunicationError(ref err) => Some(err),
Error::LibraryError(ref err) => Some(err),
- Error::RandError(ref err) => Some(err),
+ Error::RandError(ref err) => Some(err.as_ref()),
Error::UnexpectedError => None,
Error::Unknown(_) => None,
Error::Utf8Error(ref err) => Some(err),