Skip to content

Commit 9607844

Browse files
committed
Remove another deprecated type
1 parent e00c503 commit 9607844

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed

httpbis/src/client/intf.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::client::resp::ClientResponse;
2-
use crate::client::resp_future::ClientResponseFuture3;
32
use crate::client::resp_future::ClientResponseFutureImpl;
43
use crate::common::sink_after_headers::SinkAfterHeadersBox;
54
use crate::solicit_async::TryFutureBox;
@@ -10,6 +9,7 @@ use crate::HttpScheme;
109
use crate::PseudoHeaderName;
1110
use crate::SimpleHttpMessage;
1211
use crate::StreamAfterHeaders;
12+
use crate::StreamAfterHeadersBox;
1313
use bytes::Bytes;
1414
use futures::channel::oneshot;
1515
use futures::future;
@@ -88,15 +88,19 @@ pub trait ClientIntf {
8888
headers: Headers,
8989
body: Option<Bytes>,
9090
trailers: Option<Headers>,
91-
) -> ClientResponseFuture3 {
92-
ClientResponseFuture3::new(
91+
) -> TryFutureBox<(Headers, StreamAfterHeadersBox)> {
92+
Box::pin(
9393
self.start_request(headers, body, trailers, true)
9494
.and_then(move |(_sender, response)| response),
9595
)
9696
}
9797

9898
/// Start HTTP/2 `GET` request.
99-
fn start_get(&self, path: &str, authority: &str) -> ClientResponseFuture3 {
99+
fn start_get(
100+
&self,
101+
path: &str,
102+
authority: &str,
103+
) -> TryFutureBox<(Headers, StreamAfterHeadersBox)> {
100104
let headers = Headers::from_vec(vec![
101105
Header::new(PseudoHeaderName::Method, "GET"),
102106
Header::new(PseudoHeaderName::Path, path.to_owned()),
@@ -124,7 +128,12 @@ pub trait ClientIntf {
124128
}
125129

126130
/// Start HTTP/2 `POST` request with given request body.
127-
fn start_post(&self, path: &str, authority: &str, body: Bytes) -> ClientResponseFuture3 {
131+
fn start_post(
132+
&self,
133+
path: &str,
134+
authority: &str,
135+
body: Bytes,
136+
) -> TryFutureBox<(Headers, StreamAfterHeadersBox)> {
128137
let headers = Headers::from_vec(vec![
129138
Header::new(PseudoHeaderName::Method, "POST"),
130139
Header::new(PseudoHeaderName::Path, path.to_owned()),

httpbis/src/client/resp_future.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,3 @@ impl ClientResponseStreamHandler for ClientResponseStreamHandlerImpl {
136136
}
137137
}
138138
}
139-
140-
/// TODO: erase
141-
pub struct ClientResponseFuture3(
142-
Pin<Box<dyn Future<Output = crate::Result<(Headers, StreamAfterHeadersBox)>> + Send + 'static>>,
143-
);
144-
145-
impl ClientResponseFuture3 {
146-
pub fn new(
147-
future: impl Future<Output = crate::Result<(Headers, StreamAfterHeadersBox)>> + Send + 'static,
148-
) -> ClientResponseFuture3 {
149-
ClientResponseFuture3(Box::pin(future))
150-
}
151-
}
152-
153-
impl Future for ClientResponseFuture3 {
154-
type Output = crate::Result<(Headers, StreamAfterHeadersBox)>;
155-
156-
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
157-
Pin::new(&mut self.get_mut().0).poll(cx)
158-
}
159-
}

0 commit comments

Comments
 (0)