Skip to content

Commit fca07bd

Browse files
authored
style(lib): fix missing_errors_doc lint (#4154)
Refs: #4071
1 parent 72fcf54 commit fca07bd

4 files changed

Lines changed: 40 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ map_err_ignore = "allow"
131131
map_unwrap_or = "allow"
132132
match_wild_err_arm = "allow"
133133
missing_fields_in_debug = "allow" # TODO: use finish_non_exhaustive
134-
missing_errors_doc = "allow" # TODO: good to fix
135134
missing_panics_doc = "allow" # TODO: might be false
136135
multiple_inherent_impl = "allow"
137136
multiple_unsafe_ops_per_block = "allow"

src/client/conn/http1.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ where
9797

9898
/// Prevent shutdown of the underlying IO object at the end of service the request,
9999
/// instead run `into_parts`. This is a convenience wrapper over `poll_without_shutdown`.
100+
///
101+
/// # Errors
102+
///
103+
/// Returns an error if the connection encounters an error while being polled to completion.
100104
pub async fn without_shutdown(self) -> crate::Result<Parts<T>> {
101105
let mut conn = Some(self);
102106
crate::common::future::poll_fn(move |cx| -> Poll<crate::Result<Parts<T>>> {
@@ -137,6 +141,10 @@ pub struct Builder {
137141
///
138142
/// This is a shortcut for `Builder::new().handshake(io)`.
139143
/// See [`client::conn`](crate::client::conn) for more.
144+
///
145+
/// # Errors
146+
///
147+
/// Returns an error if the HTTP/1 connection handshake fails.
140148
pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
141149
where
142150
T: Read + Write + Unpin,
@@ -159,6 +167,8 @@ impl<B> SendRequest<B> {
159167

160168
/// Waits until the dispatcher is ready.
161169
///
170+
/// # Errors
171+
///
162172
/// If the associated connection is closed, this returns an Error.
163173
pub async fn ready(&mut self) -> crate::Result<()> {
164174
crate::common::future::poll_fn(|cx| self.poll_ready(cx)).await
@@ -210,6 +220,11 @@ where
210220
/// hyper closes the underlying connection when a request future is
211221
/// dropped before completion. Any subsequent calls on the same
212222
/// [`SendRequest`] will return a `canceled` error.
223+
///
224+
/// # Errors
225+
///
226+
/// Returns an error if the connection is not ready or if an error occurs while
227+
/// processing the request.
213228
pub fn send_request(
214229
&mut self,
215230
req: Request<B>,
@@ -236,7 +251,7 @@ where
236251
///
237252
/// Returns a future that if successful, yields the `Response`.
238253
///
239-
/// # Error
254+
/// # Errors
240255
///
241256
/// If there was an error before trying to serialize the request to the
242257
/// connection, the message will be returned as part of this error.
@@ -533,6 +548,10 @@ impl Builder {
533548
///
534549
/// Note, if [`Connection`] is not `await`-ed, [`SendRequest`] will
535550
/// do nothing.
551+
///
552+
/// # Errors
553+
///
554+
/// Returns an error if the HTTP/1connection handshake fails.
536555
pub fn handshake<T, B>(
537556
&self,
538557
io: T,

src/client/conn/http2.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ pub struct Builder<Ex> {
7474
///
7575
/// This is a shortcut for `Builder::new(exec).handshake(io)`.
7676
/// See [`client::conn`](crate::client::conn) for more.
77+
///
78+
/// # Errors
79+
///
80+
/// Returns an error if the HTTP/2 connection handshake fails.
7781
pub async fn handshake<E, T, B>(
7882
exec: E,
7983
io: T,
@@ -104,6 +108,8 @@ impl<B> SendRequest<B> {
104108

105109
/// Waits until the dispatcher is ready.
106110
///
111+
/// # Errors
112+
///
107113
/// If the associated connection is closed, this returns an Error.
108114
pub async fn ready(&mut self) -> crate::Result<()> {
109115
crate::common::future::poll_fn(|cx| self.poll_ready(cx)).await
@@ -147,6 +153,11 @@ where
147153
/// other in-flight and future requests. The peer is notified
148154
/// immediately rather than continuing to send a response body that
149155
/// would be discarded.
156+
///
157+
/// # Errors
158+
///
159+
/// Returns an error if the connection is not ready or if an error occurs while
160+
/// processing the request.
150161
pub fn send_request(
151162
&mut self,
152163
req: Request<B>,
@@ -174,7 +185,7 @@ where
174185
///
175186
/// Returns a future that if successful, yields the `Response`.
176187
///
177-
/// # Error
188+
/// # Errors
178189
///
179190
/// If there was an error before trying to serialize the request to the
180191
/// connection, the message will be returned as part of this error.
@@ -547,6 +558,10 @@ where
547558
///
548559
/// Note, if [`Connection`] is not `await`-ed, [`SendRequest`] will
549560
/// do nothing.
561+
///
562+
/// # Errors
563+
///
564+
/// Returns an error if the HTTP/2 connection handshake fails.
550565
pub fn handshake<T, B>(
551566
&self,
552567
io: T,

src/upgrade.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ impl Upgraded {
147147

148148
/// Tries to downcast the internal trait object to the type passed.
149149
///
150-
/// On success, returns the downcasted parts. On error, returns the
151-
/// `Upgraded` back.
150+
/// On success, returns the downcasted parts.
151+
///
152+
/// # Errors
153+
/// On error, returns the `Upgraded` back.
152154
pub fn downcast<T: Read + Write + Unpin + 'static>(self) -> Result<Parts<T>, Self> {
153155
let (io, buf) = self.io.into_inner();
154156
match io.__hyper_downcast() {

0 commit comments

Comments
 (0)