From dd04ec0ef462670cc3b3cba02957a85e01f32e9c Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 6 Apr 2021 10:04:46 +0200 Subject: [PATCH 1/2] Provide access to inner I/O error during handshake --- tokio-boring/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tokio-boring/src/lib.rs b/tokio-boring/src/lib.rs index 1ed5c25a..35b9dac9 100644 --- a/tokio-boring/src/lib.rs +++ b/tokio-boring/src/lib.rs @@ -292,6 +292,14 @@ impl HandshakeError { _ => None, } } + + /// Returns a reference to the inner I/O error, if any. + pub fn as_io_error(&self) -> Option<&io::Error> { + match &self.0 { + ssl::HandshakeError::Failure(s) => s.error().io_error(), + _ => None, + } + } } impl fmt::Debug for HandshakeError From e13112e3ca889b75007d9fb8345f2281cf9c9cfd Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 6 Apr 2021 10:47:10 +0200 Subject: [PATCH 2/2] Allow uppercase acronyms --- boring-sys/src/lib.rs | 1 + boring/src/ssl/bio.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/boring-sys/src/lib.rs b/boring-sys/src/lib.rs index da297649..4c783232 100644 --- a/boring-sys/src/lib.rs +++ b/boring-sys/src/lib.rs @@ -3,6 +3,7 @@ clippy::redundant_static_lifetimes, clippy::too_many_arguments, clippy::unreadable_literal, + clippy::upper_case_acronyms, improper_ctypes, non_camel_case_types, non_snake_case, diff --git a/boring/src/ssl/bio.rs b/boring/src/ssl/bio.rs index bef906f9..9d02fc00 100644 --- a/boring/src/ssl/bio.rs +++ b/boring/src/ssl/bio.rs @@ -213,7 +213,7 @@ use ffi::{BIO_get_data, BIO_set_data, BIO_set_flags, BIO_set_init}; #[allow(bad_style)] unsafe fn BIO_set_num(_bio: *mut ffi::BIO, _num: c_int) {} -#[allow(bad_style)] +#[allow(bad_style, clippy::upper_case_acronyms)] struct BIO_METHOD(*mut ffi::BIO_METHOD); impl BIO_METHOD {