File tree 3 files changed +13
-25
lines changed 3 files changed +13
-25
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,6 @@ pub(crate) mod basic {
101
101
self . payload . params . body = Some ( body) ;
102
102
self
103
103
}
104
-
105
- /// Consume and send the [`Request`].
106
- async fn send ( self ) -> Result < ( ) > {
107
- self . client . handle_request ( & self ) . await
108
- }
109
104
}
110
105
111
106
impl < ' a , C > Endpoint for Request < ' a , C >
@@ -128,8 +123,9 @@ pub(crate) mod basic {
128
123
129
124
type IntoFuture = impl Future < Output = Self :: Output > ;
130
125
126
+ /// Consume and send the [`Request`].
131
127
fn into_future ( self ) -> Self :: IntoFuture {
132
- self . send ( )
128
+ async move { self . client . handle_request ( & self ) . await }
133
129
}
134
130
}
135
131
Original file line number Diff line number Diff line change @@ -55,19 +55,15 @@ where
55
55
self . expand_merchant = true ;
56
56
self
57
57
}
58
-
59
- /// Consume the request and return the [`Transaction`]
60
- async fn send ( self ) -> Result < Transaction > {
61
- self . client . handle_request ( & self ) . await
62
- }
63
58
}
64
59
65
60
impl < ' a > IntoFuture for Request < ' a > {
66
61
type Output = Result < Transaction > ;
67
62
68
63
type IntoFuture = impl Future < Output = Self :: Output > ;
69
64
65
+ /// Consume the request and return the [`Transaction`]
70
66
fn into_future ( self ) -> Self :: IntoFuture {
71
- self . send ( )
67
+ async move { self . client . handle_request ( & self ) . await }
72
68
}
73
69
}
Original file line number Diff line number Diff line change @@ -80,27 +80,23 @@ where
80
80
self . query . expand_merchant = Some ( "merchant" ) ;
81
81
self
82
82
}
83
-
84
- /// Consume the request and return the list of [`Transaction`]s
85
- async fn send ( self ) -> Result < Vec < Transaction > > {
86
- #[ derive( Deserialize ) ]
87
- struct Response {
88
- transactions : Vec < Transaction > ,
89
- }
90
-
91
- let response: Response = self . client . handle_request ( & self ) . await ?;
92
-
93
- Ok ( response. transactions )
94
- }
95
83
}
96
84
97
85
impl < ' a > IntoFuture for Request < ' a > {
98
86
type Output = Result < Vec < Transaction > > ;
99
87
100
88
type IntoFuture = impl Future < Output = Self :: Output > ;
101
89
90
+ /// Consume the request and return the list of [`Transaction`]s
102
91
fn into_future ( self ) -> Self :: IntoFuture {
103
- self . send ( )
92
+ #[ derive( Deserialize ) ]
93
+ struct Response {
94
+ transactions : Vec < Transaction > ,
95
+ }
96
+ async move {
97
+ let response: Response = self . client . handle_request ( & self ) . await ?;
98
+ Ok ( response. transactions )
99
+ }
104
100
}
105
101
}
106
102
You can’t perform that action at this time.
0 commit comments