Switch to rand_os for random bytes.
This commit is contained in:
parent
392b1c66b1
commit
506d0b17fc
3 changed files with 15 additions and 11 deletions
|
|
@ -1,19 +1,19 @@
|
|||
#[cfg(feature = "scram")]
|
||||
use openssl::error::ErrorStack;
|
||||
use rand_os::rand_core::Error as RngError;
|
||||
|
||||
/// A wrapper enum for things that could go wrong in this crate.
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
#[cfg(feature = "scram")]
|
||||
/// An error in OpenSSL.
|
||||
OpenSslErrorStack(ErrorStack),
|
||||
/// An error while initializing the Rng.
|
||||
RngError(RngError),
|
||||
/// An error in a SASL mechanism.
|
||||
SaslError(String),
|
||||
}
|
||||
|
||||
#[cfg(feature = "scram")]
|
||||
impl From<ErrorStack> for Error {
|
||||
fn from(err: ErrorStack) -> Error {
|
||||
Error::OpenSslErrorStack(err)
|
||||
impl From<RngError> for Error {
|
||||
fn from(err: RngError) -> Error {
|
||||
Error::RngError(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue