@@ -9,7 +9,7 @@ use futures::{ready, TryFuture};
99use http;
1010use hyper;
1111use linkerd2_error:: Error ;
12- use pin_project:: { pin_project, project } ;
12+ use pin_project:: pin_project;
1313use std:: future:: Future ;
1414use std:: marker:: PhantomData ;
1515use std:: pin:: Pin ;
@@ -35,7 +35,7 @@ pub struct MakeClient<C, B> {
3535}
3636
3737/// A `Future` returned from `MakeClient::new_service()`.
38- #[ pin_project]
38+ #[ pin_project( project = MakeFutureProj ) ]
3939pub enum MakeFuture < C , T , B >
4040where
4141 B : hyper:: body:: HttpBody + Send + ' static ,
6060 Http2 ( h2:: Connection < B > ) ,
6161}
6262
63- #[ pin_project]
63+ #[ pin_project( project = ClientFutureProj ) ]
6464pub enum ClientFuture {
6565 Http1 {
6666 #[ pin]
@@ -183,12 +183,10 @@ where
183183{
184184 type Output = Result < Client < C , T , B > , Error > ;
185185
186- #[ project]
187186 fn poll ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
188- #[ project]
189187 let svc = match self . project ( ) {
190- MakeFuture :: Http1 ( h1) => Client :: Http1 ( h1. take ( ) . expect ( "poll more than once" ) ) ,
191- MakeFuture :: Http2 ( h2) => {
188+ MakeFutureProj :: Http1 ( h1) => Client :: Http1 ( h1. take ( ) . expect ( "poll more than once" ) ) ,
189+ MakeFutureProj :: Http2 ( h2) => {
192190 let svc = ready ! ( h2. poll( cx) ) ?;
193191 Client :: Http2 ( svc)
194192 }
@@ -253,11 +251,9 @@ where
253251impl Future for ClientFuture {
254252 type Output = Result < http:: Response < Body > , Error > ;
255253
256- #[ project]
257254 fn poll ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
258- #[ project]
259255 match self . project ( ) {
260- ClientFuture :: Http1 {
256+ ClientFutureProj :: Http1 {
261257 future,
262258 upgrade,
263259 is_http_connect,
@@ -277,7 +273,7 @@ impl Future for ClientFuture {
277273 }
278274 Poll :: Ready ( Ok ( res) )
279275 }
280- ClientFuture :: Http2 ( f) => f. poll ( cx) . map_err ( Into :: into) ,
276+ ClientFutureProj :: Http2 ( f) => f. poll ( cx) . map_err ( Into :: into) ,
281277 }
282278 }
283279}
0 commit comments