Skip to content

Commit 28da8a3

Browse files
authored
docs(client): correct the docs of hyper::client::conn::http1::Builder::executor (#3090)
Closes #3086
1 parent ab59a6f commit 28da8a3

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/client/conn/http1.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ use http::{Request, Response};
99
use httparse::ParserConfig;
1010
use tokio::io::{AsyncRead, AsyncWrite};
1111

12-
use crate::body::{Body, Incoming as IncomingBody};
1312
use super::super::dispatch;
13+
use crate::body::{Body, Incoming as IncomingBody};
1414
use crate::common::{
1515
exec::{BoxSendFuture, Exec},
1616
task, Future, Pin, Poll,
1717
};
1818
use crate::proto;
19-
use crate::rt::{Executor};
19+
use crate::rt::Executor;
2020
use crate::upgrade::Upgraded;
2121

2222
type Dispatcher<T, B> =
@@ -47,7 +47,6 @@ pub struct Parts<T> {
4747
_inner: (),
4848
}
4949

50-
5150
/// A future that processes all HTTP state for the IO object.
5251
///
5352
/// In most cases, this should just be spawned into an executor, so that it
@@ -91,7 +90,10 @@ where
9190
/// and [`try_ready!`](https://docs.rs/futures/0.1.25/futures/macro.try_ready.html)
9291
/// to work with this function; or use the `without_shutdown` wrapper.
9392
pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll<crate::Result<()>> {
94-
self.inner.as_mut().expect("algready upgraded").poll_without_shutdown(cx)
93+
self.inner
94+
.as_mut()
95+
.expect("algready upgraded")
96+
.poll_without_shutdown(cx)
9597
}
9698
}
9799

@@ -116,9 +118,7 @@ pub struct Builder {
116118
///
117119
/// This is a shortcut for `Builder::new().handshake(io)`.
118120
/// See [`client::conn`](crate::client::conn) for more.
119-
pub async fn handshake<T, B>(
120-
io: T,
121-
) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
121+
pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
122122
where
123123
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
124124
B: Body + 'static,
@@ -302,7 +302,7 @@ impl Builder {
302302
}
303303
}
304304

305-
/// Provide an executor to execute background HTTP2 tasks.
305+
/// Provide an executor to execute background HTTP1 tasks.
306306
pub fn executor<E>(&mut self, exec: E) -> &mut Builder
307307
where
308308
E: Executor<BoxSendFuture> + Send + Sync + 'static,
@@ -399,10 +399,7 @@ impl Builder {
399399
/// Note that this setting does not affect HTTP/2.
400400
///
401401
/// Default is false.
402-
pub fn http1_ignore_invalid_headers_in_responses(
403-
&mut self,
404-
enabled: bool,
405-
) -> &mut Builder {
402+
pub fn http1_ignore_invalid_headers_in_responses(&mut self, enabled: bool) -> &mut Builder {
406403
self.h1_parser_config
407404
.ignore_invalid_headers_in_responses(enabled);
408405
self

0 commit comments

Comments
 (0)