Skip to content

Commit 5625992

Browse files
committed
tidy
1 parent 726da2f commit 5625992

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

src/endpoints/feed_items.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ pub(crate) mod basic {
101101
self.payload.params.body = Some(body);
102102
self
103103
}
104-
105-
/// Consume and send the [`Request`].
106-
async fn send(self) -> Result<()> {
107-
self.client.handle_request(&self).await
108-
}
109104
}
110105

111106
impl<'a, C> Endpoint for Request<'a, C>
@@ -128,8 +123,9 @@ pub(crate) mod basic {
128123

129124
type IntoFuture = impl Future<Output = Self::Output>;
130125

126+
/// Consume and send the [`Request`].
131127
fn into_future(self) -> Self::IntoFuture {
132-
self.send()
128+
async move { self.client.handle_request(&self).await }
133129
}
134130
}
135131

src/endpoints/transactions/get.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,15 @@ where
5555
self.expand_merchant = true;
5656
self
5757
}
58-
59-
/// Consume the request and return the [`Transaction`]
60-
async fn send(self) -> Result<Transaction> {
61-
self.client.handle_request(&self).await
62-
}
6358
}
6459

6560
impl<'a> IntoFuture for Request<'a> {
6661
type Output = Result<Transaction>;
6762

6863
type IntoFuture = impl Future<Output = Self::Output>;
6964

65+
/// Consume the request and return the [`Transaction`]
7066
fn into_future(self) -> Self::IntoFuture {
71-
self.send()
67+
async move { self.client.handle_request(&self).await }
7268
}
7369
}

src/endpoints/transactions/list.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,23 @@ where
8080
self.query.expand_merchant = Some("merchant");
8181
self
8282
}
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-
}
9583
}
9684

9785
impl<'a> IntoFuture for Request<'a> {
9886
type Output = Result<Vec<Transaction>>;
9987

10088
type IntoFuture = impl Future<Output = Self::Output>;
10189

90+
/// Consume the request and return the list of [`Transaction`]s
10291
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+
}
104100
}
105101
}
106102

0 commit comments

Comments
 (0)