diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index c265195e..0bc0d316 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -259,7 +259,7 @@ fn parse_version(version: &str) -> u64 { // and the type specifier suffix let version = version.trim_right_matches(|c: char| match c { - '0'...'9' | 'a'...'f' | 'A'...'F' => false, + '0'..='9' | 'a'..='f' | 'A'..='F' => false, _ => true, }); diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 5a768a44..c87b4f56 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -88,10 +88,10 @@ pub type PasswordCallback = unsafe extern "C" fn( #[cfg(ossl110)] pub fn init() { use std::ptr; - use std::sync::{Once, ONCE_INIT}; + use std::sync::Once; // explicitly initialize to work around https://github.com/openssl/openssl/issues/3505 - static INIT: Once = ONCE_INIT; + static INIT: Once = Once::new(); INIT.call_once(|| unsafe { OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, ptr::null_mut()); diff --git a/openssl/src/ssl/bio.rs b/openssl/src/ssl/bio.rs index c1c5f871..d33db296 100644 --- a/openssl/src/ssl/bio.rs +++ b/openssl/src/ssl/bio.rs @@ -17,7 +17,7 @@ use error::ErrorStack; pub struct StreamState { pub stream: S, pub error: Option, - pub panic: Option>, + pub panic: Option>, } /// Safe wrapper for BIO_METHOD @@ -55,7 +55,7 @@ pub unsafe fn take_error(bio: *mut BIO) -> Option { state.error.take() } -pub unsafe fn take_panic(bio: *mut BIO) -> Option> { +pub unsafe fn take_panic(bio: *mut BIO) -> Option> { let state = state::(bio); state.panic.take() } diff --git a/openssl/src/ssl/error.rs b/openssl/src/ssl/error.rs index e5e8991a..044b8e83 100644 --- a/openssl/src/ssl/error.rs +++ b/openssl/src/ssl/error.rs @@ -127,7 +127,7 @@ impl error::Error for Error { "an OpenSSL error" } - fn cause(&self) -> Option<&error::Error> { + fn cause(&self) -> Option<&dyn error::Error> { match self.cause { Some(InnerError::Io(ref e)) => Some(e), Some(InnerError::Ssl(ref e)) => Some(e), @@ -159,7 +159,7 @@ impl StdError for HandshakeError { } } - fn cause(&self) -> Option<&StdError> { + fn cause(&self) -> Option<&dyn StdError> { match *self { HandshakeError::SetupFailure(ref e) => Some(e), HandshakeError::Failure(ref s) | HandshakeError::WouldBlock(ref s) => Some(s.error()), diff --git a/openssl/src/ssl/test/server.rs b/openssl/src/ssl/test/server.rs index acd9b685..fe24531e 100644 --- a/openssl/src/ssl/test/server.rs +++ b/openssl/src/ssl/test/server.rs @@ -46,8 +46,8 @@ impl Server { pub struct Builder { ctx: SslContextBuilder, - ssl_cb: Box, - io_cb: Box) + Send>, + ssl_cb: Box, + io_cb: Box) + Send>, should_error: bool, } diff --git a/openssl/src/util.rs b/openssl/src/util.rs index 8c8d41a9..cda43755 100644 --- a/openssl/src/util.rs +++ b/openssl/src/util.rs @@ -14,7 +14,7 @@ pub struct CallbackState { cb: Option, /// If the callback panics, we place the panic object here, to be re-thrown once OpenSSL /// returns. - panic: Option>, + panic: Option>, } impl CallbackState {