From 753aab25ec288086ae19134f79c4ecae61a80438 Mon Sep 17 00:00:00 2001 From: Phoenix Kahlo Date: Wed, 30 Oct 2024 03:46:24 -0700 Subject: [PATCH] chore: Fix docs warnings (#156) --- src/client/legacy/connect/capture.rs | 2 ++ src/client/legacy/connect/dns.rs | 3 +-- src/client/legacy/connect/http.rs | 2 +- src/server/conn/auto/mod.rs | 6 ++++++ src/server/conn/auto/upgrade.rs | 4 +++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/client/legacy/connect/capture.rs b/src/client/legacy/connect/capture.rs index 4fbe384..fdce6bf 100644 --- a/src/client/legacy/connect/capture.rs +++ b/src/client/legacy/connect/capture.rs @@ -19,6 +19,8 @@ pub struct CaptureConnection { /// [`capture_connection`] allows a caller to capture the returned [`Connected`] structure as soon /// as the connection is established. /// +/// [`Connection`]: crate::client::legacy::connect::Connection +/// /// *Note*: If establishing a connection fails, [`CaptureConnection::connection_metadata`] will always return none. /// /// # Examples diff --git a/src/client/legacy/connect/dns.rs b/src/client/legacy/connect/dns.rs index 7530d12..2a0b53f 100644 --- a/src/client/legacy/connect/dns.rs +++ b/src/client/legacy/connect/dns.rs @@ -2,8 +2,7 @@ //! //! This module contains: //! -//! - A [`GaiResolver`](GaiResolver) that is the default resolver for the -//! `HttpConnector`. +//! - A [`GaiResolver`] that is the default resolver for the `HttpConnector`. //! - The `Name` type used as an argument to custom resolvers. //! //! # Resolvers are `Service`s diff --git a/src/client/legacy/connect/http.rs b/src/client/legacy/connect/http.rs index 05a19f4..2ff704c 100644 --- a/src/client/legacy/connect/http.rs +++ b/src/client/legacy/connect/http.rs @@ -168,7 +168,7 @@ impl HttpConnector { impl HttpConnector { /// Construct a new HttpConnector. /// - /// Takes a [`Resolver`](crate::client::connect::dns#resolvers-are-services) to handle DNS lookups. + /// Takes a [`Resolver`](crate::client::legacy::connect::dns#resolvers-are-services) to handle DNS lookups. pub fn new_with_resolver(resolver: R) -> HttpConnector { HttpConnector { config: Arc::new(Config { diff --git a/src/server/conn/auto/mod.rs b/src/server/conn/auto/mod.rs index afe5a39..b7cac59 100644 --- a/src/server/conn/auto/mod.rs +++ b/src/server/conn/auto/mod.rs @@ -110,6 +110,8 @@ impl Builder { /// Only accepts HTTP/2 /// /// Does not do anything if used with [`serve_connection_with_upgrades`] + /// + /// [`serve_connection_with_upgrades`]: Builder::serve_connection_with_upgrades #[cfg(feature = "http2")] pub fn http2_only(mut self) -> Self { assert!(self.version.is_none()); @@ -120,6 +122,8 @@ impl Builder { /// Only accepts HTTP/1 /// /// Does not do anything if used with [`serve_connection_with_upgrades`] + /// + /// [`serve_connection_with_upgrades`]: Builder::serve_connection_with_upgrades #[cfg(feature = "http1")] pub fn http1_only(mut self) -> Self { assert!(self.version.is_none()); @@ -169,6 +173,8 @@ impl Builder { /// Note that if you ever want to use [`hyper::upgrade::Upgraded::downcast`] /// with this crate, you'll need to use [`hyper_util::server::conn::auto::upgrade::downcast`] /// instead. See the documentation of the latter to understand why. + /// + /// [`hyper_util::server::conn::auto::upgrade::downcast`]: crate::server::conn::auto::upgrade::downcast pub fn serve_connection_with_upgrades( &self, io: I, diff --git a/src/server/conn/auto/upgrade.rs b/src/server/conn/auto/upgrade.rs index f4063bc..8d94c40 100644 --- a/src/server/conn/auto/upgrade.rs +++ b/src/server/conn/auto/upgrade.rs @@ -12,9 +12,11 @@ use crate::common::rewind::Rewind; /// /// On success, returns the downcasted parts. On error, returns the Upgraded back. /// This is a kludge to work around the fact that the machinery provided by -/// [`hyper_util::server::con::auto`] wraps the inner `T` with a private type +/// [`hyper_util::server::conn::auto`] wraps the inner `T` with a private type /// that is not reachable from outside the crate. /// +/// [`hyper_util::server::conn::auto`]: crate::server::conn::auto +/// /// This kludge will be removed when this machinery is added back to the main /// `hyper` code. pub fn downcast(upgraded: Upgraded) -> Result, Upgraded>