From 3f402dc13530ce4de167bae843200cfbd72ed69b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 8 Jul 2020 22:22:10 +0200 Subject: Remove Error::RandError variant Since we update rand_os to version 0.2 in commit 6c138eaa850c745b97b7e48a201db0cbaad8e1e0, the random number generation can no longer fail. Therefore the Error::RandError variant is no longer needed. As we did not want to break the public API, we still kept the RandError variant. This patch removes the RandError variant for good. --- src/error.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/error.rs b/src/error.rs index e0698a2..995741b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,8 +22,6 @@ pub enum Error { LibraryError(LibraryError), /// An error that occurred due to a poisoned lock. PoisonError, - /// An error that occurred during random number generation. - RandError(Box), /// An error that is caused by an unexpected value returned by libnitrokey. UnexpectedError(String), /// An unknown error returned by libnitrokey. @@ -101,7 +99,6 @@ impl error::Error for Error { Error::ConcurrentAccessError => None, Error::LibraryError(ref err) => Some(err), Error::PoisonError => None, - Error::RandError(ref err) => Some(err.as_ref()), Error::UnexpectedError(_) => None, Error::UnknownError(_) => None, Error::UnsupportedModelError => None, @@ -118,7 +115,6 @@ impl fmt::Display for Error { Error::ConcurrentAccessError => write!(f, "Internal error: concurrent access"), Error::LibraryError(ref err) => write!(f, "Library error: {}", err), Error::PoisonError => write!(f, "Internal error: poisoned lock"), - Error::RandError(ref err) => write!(f, "RNG error: {}", err), Error::UnexpectedError(ref s) => write!(f, "An unexpected error occurred: {}", s), Error::UnknownError(ref err) => write!(f, "Unknown error: {}", err), Error::UnsupportedModelError => write!(f, "Unsupported Nitrokey model"), -- cgit v1.2.1