Skip to content

Commit 6c9e31b

Browse files
tgeoghegandjc
authored andcommitted
Document dependency on http2 feature
Annotates the rustdoc on `ConnectorBuilder<WantsProtocols{1,2}>::enable_http2` so that docs.rs will plainly tell users that crate feature `http2` must be enabled.
1 parent 634f0af commit 6c9e31b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/connector/builder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ impl ConnectorBuilder<WantsProtocols1> {
161161
///
162162
/// This needs to be called explicitly, no protocol is enabled by default
163163
#[cfg(feature = "http2")]
164+
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
164165
pub fn enable_http2(mut self) -> ConnectorBuilder<WantsProtocols3> {
165166
self.0.tls_config.alpn_protocols = vec![b"h2".to_vec()];
166167
ConnectorBuilder(WantsProtocols3 {
@@ -185,6 +186,7 @@ impl ConnectorBuilder<WantsProtocols2> {
185186
///
186187
/// This needs to be called explicitly, no protocol is enabled by default
187188
#[cfg(feature = "http2")]
189+
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
188190
pub fn enable_http2(mut self) -> ConnectorBuilder<WantsProtocols3> {
189191
self.0.inner.tls_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()];
190192
ConnectorBuilder(WantsProtocols3 {

0 commit comments

Comments
 (0)