Skip to content

Commit a06bf80

Browse files
committed
Fix SSL error types only being present on sync API
1 parent 2fa605e commit a06bf80

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

src/lib.rs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,20 @@ pub mod error {
554554
pub enum Error {
555555
/// An I/O error occurred
556556
IoError(std::io::Error),
557-
#[cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv")))]
557+
#[cfg(any(
558+
feature = "ssl",
559+
feature = "sslv",
560+
feature = "aio-ssl",
561+
feature = "aio-sslv"
562+
))]
558563
#[cfg_attr(
559564
docsrs,
560-
doc(cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv"))))
565+
doc(cfg(any(
566+
feature = "ssl",
567+
feature = "sslv",
568+
feature = "aio-ssl",
569+
feature = "aio-sslv"
570+
)))
561571
)]
562572
/// An SSL error occurred
563573
SslError(openssl::ssl::Error),
@@ -567,14 +577,11 @@ pub mod error {
567577
ParseError,
568578
}
569579

570-
#[cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv")))]
571-
#[cfg_attr(
572-
docsrs,
573-
doc(cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv"))))
574-
)]
575-
impl From<openssl::ssl::Error> for Error {
576-
fn from(err: openssl::ssl::Error) -> Self {
577-
Self::SslError(err)
580+
cfg_ssl_any! {
581+
impl From<openssl::ssl::Error> for Error {
582+
fn from(err: openssl::ssl::Error) -> Self {
583+
Self::SslError(err)
584+
}
578585
}
579586
}
580587

@@ -584,16 +591,13 @@ pub mod error {
584591
}
585592
}
586593

587-
#[cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv")))]
588-
#[cfg_attr(
589-
docsrs,
590-
doc(cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv"))))
591-
)]
592-
impl From<SslError> for Error {
593-
fn from(err: SslError) -> Self {
594-
match err {
595-
SslError::IoError(ioerr) => Self::IoError(ioerr),
596-
SslError::SslError(sslerr) => Self::SslError(sslerr),
594+
cfg_ssl_any! {
595+
impl From<SslError> for Error {
596+
fn from(err: SslError) -> Self {
597+
match err {
598+
SslError::IoError(ioerr) => Self::IoError(ioerr),
599+
SslError::SslError(sslerr) => Self::SslError(sslerr),
600+
}
597601
}
598602
}
599603
}

0 commit comments

Comments
 (0)