Skip to content

Commit

Permalink
Document dependency on http2 feature
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tgeoghegan authored and djc committed Jan 3, 2022
1 parent 634f0af commit 6c9e31b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/connector/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl ConnectorBuilder<WantsProtocols1> {
///
/// This needs to be called explicitly, no protocol is enabled by default
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn enable_http2(mut self) -> ConnectorBuilder<WantsProtocols3> {
self.0.tls_config.alpn_protocols = vec![b"h2".to_vec()];
ConnectorBuilder(WantsProtocols3 {
Expand All @@ -185,6 +186,7 @@ impl ConnectorBuilder<WantsProtocols2> {
///
/// This needs to be called explicitly, no protocol is enabled by default
#[cfg(feature = "http2")]
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
pub fn enable_http2(mut self) -> ConnectorBuilder<WantsProtocols3> {
self.0.inner.tls_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()];
ConnectorBuilder(WantsProtocols3 {
Expand Down

0 comments on commit 6c9e31b

Please sign in to comment.