Skip to content

Commit f1a5b91

Browse files
authored
chore(tls): fix dead code warning (#1703)
1 parent f9d19e1 commit f1a5b91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tonic/src/transport/service/connector.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use super::io::BoxedIo;
33
#[cfg(feature = "tls")]
44
use super::tls::TlsConnector;
55
use http::Uri;
6+
#[cfg(feature = "tls")]
67
use std::fmt;
78
use std::task::{Context, Poll};
89
use tower::make::MakeConnection;
@@ -97,14 +98,17 @@ where
9798
}
9899

99100
/// Error returned when trying to connect to an HTTPS endpoint without TLS enabled.
101+
#[cfg(feature = "tls")]
100102
#[derive(Debug)]
101103
pub(crate) struct HttpsUriWithoutTlsSupport(());
102104

105+
#[cfg(feature = "tls")]
103106
impl fmt::Display for HttpsUriWithoutTlsSupport {
104107
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
105108
write!(f, "Connecting to HTTPS without TLS enabled")
106109
}
107110
}
108111

109112
// std::error::Error only requires a type to impl Debug and Display
113+
#[cfg(feature = "tls")]
110114
impl std::error::Error for HttpsUriWithoutTlsSupport {}

0 commit comments

Comments
 (0)