Skip to content

Commit 1de9acc

Browse files
authoredJan 4, 2023
feat(client): remove unneeded HTTP/1 executor (#3108)
BREAKING CHANGE: The method `hyper::client::conn::http1::Builder::executor()` is removed, since it did nothing.
1 parent bb609b2 commit 1de9acc

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed
 

‎src/client/conn/http1.rs

-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use std::error::Error as StdError;
44
use std::fmt;
5-
use std::sync::Arc;
65

76
use bytes::Bytes;
87
use http::{Request, Response};
@@ -12,11 +11,9 @@ use tokio::io::{AsyncRead, AsyncWrite};
1211
use super::super::dispatch;
1312
use crate::body::{Body, Incoming as IncomingBody};
1413
use crate::common::{
15-
exec::{BoxSendFuture, Exec},
1614
task, Future, Pin, Poll,
1715
};
1816
use crate::proto;
19-
use crate::rt::Executor;
2017
use crate::upgrade::Upgraded;
2118

2219
type Dispatcher<T, B> =
@@ -102,7 +99,6 @@ where
10299
/// After setting options, the builder is used to create a handshake future.
103100
#[derive(Clone, Debug)]
104101
pub struct Builder {
105-
pub(super) exec: Exec,
106102
h09_responses: bool,
107103
h1_parser_config: ParserConfig,
108104
h1_writev: Option<bool>,
@@ -289,7 +285,6 @@ impl Builder {
289285
#[inline]
290286
pub fn new() -> Builder {
291287
Builder {
292-
exec: Exec::Default,
293288
h09_responses: false,
294289
h1_writev: None,
295290
h1_read_buf_exact_size: None,
@@ -302,15 +297,6 @@ impl Builder {
302297
}
303298
}
304299

305-
/// Provide an executor to execute background HTTP1 tasks.
306-
pub fn executor<E>(&mut self, exec: E) -> &mut Builder
307-
where
308-
E: Executor<BoxSendFuture> + Send + Sync + 'static,
309-
{
310-
self.exec = Exec::Executor(Arc::new(exec));
311-
self
312-
}
313-
314300
/// Set whether HTTP/0.9 responses should be tolerated.
315301
///
316302
/// Default is false.

‎src/ffi/client.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ ffi_fn! {
6565
}));
6666
hyper_clientconn { tx: Tx::Http2(tx) }
6767
});
68-
}
68+
}
6969
}
7070

7171
conn::http1::Builder::new()
72-
.executor(options.exec.clone())
7372
.allow_obsolete_multiline_headers_in_responses(options.http1_allow_obsolete_multiline_headers_in_responses)
7473
.preserve_header_case(options.http1_preserve_header_case)
7574
.preserve_header_order(options.http1_preserve_header_order)

‎src/server/conn/http1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pin_project_lite::pin_project! {
3535
/// A configuration builder for HTTP/1 server connections.
3636
#[derive(Clone, Debug)]
3737
pub struct Builder {
38-
pub(crate) timer: Time,
38+
timer: Time,
3939
h1_half_close: bool,
4040
h1_keep_alive: bool,
4141
h1_title_case_headers: bool,

‎tests/server.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3029,7 +3029,6 @@ impl TestClient {
30293029
sender.send_request(req).await
30303030
} else {
30313031
let (mut sender, conn) = hyper::client::conn::http1::Builder::new()
3032-
.executor(TokioExecutor)
30333032
.handshake(stream)
30343033
.await
30353034
.unwrap();

0 commit comments

Comments
 (0)
Please sign in to comment.