@@ -5,19 +5,16 @@ use std::path::PathBuf;
5
5
6
6
use derive_more:: From ;
7
7
8
- use futures:: future:: select_all;
9
8
use futures:: sink:: SinkExt ;
10
9
use futures:: stream:: StreamExt ;
11
10
12
11
use structopt:: StructOpt ;
13
12
14
13
use app:: common:: {
15
- Commit , Currency , InvoiceId , MultiRoute , PaymentId , PaymentStatus , PaymentStatusSuccess ,
16
- PublicKey , Uid ,
14
+ Currency , InvoiceId , MultiRoute , PaymentId , PaymentStatus , PaymentStatusSuccess , PublicKey , Uid ,
17
15
} ;
18
16
use app:: conn:: {
19
- self , buyer, routes, AppServerToApp , AppToAppServer , ConnPairApp , RequestResult ,
20
- ResponseRoutesResult ,
17
+ self , AppServerToApp , AppToAppServer , ConnPairApp , RequestResult , ResponseRoutesResult ,
21
18
} ;
22
19
use app:: gen:: { gen_payment_id, gen_uid} ;
23
20
use app:: report:: NodeReport ;
@@ -122,7 +119,7 @@ async fn request_routes(
122
119
. sender
123
120
. send ( app_to_app_server)
124
121
. await
125
- . map_err ( |_| BuyerError :: AppRoutesError ) ;
122
+ . map_err ( |_| BuyerError :: AppRoutesError ) ? ;
126
123
127
124
// Wait until we get back response routes:
128
125
while let Some ( app_server_to_app) = conn_pair. receiver . next ( ) . await {
@@ -163,7 +160,7 @@ async fn create_payment(
163
160
. sender
164
161
. send ( app_to_app_server)
165
162
. await
166
- . map_err ( |_| BuyerError :: CreatePaymentFailed ) ;
163
+ . map_err ( |_| BuyerError :: CreatePaymentFailed ) ? ;
167
164
168
165
while let Some ( app_server_to_app) = conn_pair. receiver . next ( ) . await {
169
166
if let AppServerToApp :: ReportMutations ( report_mutations) = app_server_to_app {
@@ -196,7 +193,7 @@ async fn request_close_payment_nowait(
196
193
. sender
197
194
. send ( app_to_app_server)
198
195
. await
199
- . map_err ( |_| BuyerError :: RequestClosePaymentError ) ;
196
+ . map_err ( |_| BuyerError :: RequestClosePaymentError ) ? ;
200
197
201
198
while let Some ( app_server_to_app) = conn_pair. receiver . next ( ) . await {
202
199
if let AppServerToApp :: ReportMutations ( report_mutations) = app_server_to_app {
@@ -229,7 +226,7 @@ async fn request_close_payment(
229
226
. sender
230
227
. send ( app_to_app_server)
231
228
. await
232
- . map_err ( |_| BuyerError :: RequestClosePaymentError ) ;
229
+ . map_err ( |_| BuyerError :: RequestClosePaymentError ) ? ;
233
230
234
231
while let Some ( app_server_to_app) = conn_pair. receiver . next ( ) . await {
235
232
if let AppServerToApp :: ResponseClosePayment ( response_close_payment) = app_server_to_app {
@@ -261,7 +258,7 @@ async fn ack_close_payment(
261
258
. sender
262
259
. send ( app_to_app_server)
263
260
. await
264
- . map_err ( |_| BuyerError :: AckClosePaymentError ) ;
261
+ . map_err ( |_| BuyerError :: AckClosePaymentError ) ? ;
265
262
266
263
while let Some ( app_server_to_app) = conn_pair. receiver . next ( ) . await {
267
264
if let AppServerToApp :: ReportMutations ( report_mutations) = app_server_to_app {
@@ -377,7 +374,7 @@ async fn buyer_pay_invoice(
377
374
. sender
378
375
. send ( app_to_app_server)
379
376
. await
380
- . map_err ( |_| BuyerError :: CreateTransactionFailed ) ;
377
+ . map_err ( |_| BuyerError :: CreateTransactionFailed ) ? ;
381
378
}
382
379
383
380
// Signal that no new transactions will be created:
@@ -482,7 +479,7 @@ async fn buyer_payment_status(
482
479
pub async fn buyer (
483
480
buyer_cmd : BuyerCmd ,
484
481
node_report : & NodeReport ,
485
- mut conn_pair : ConnPairApp ,
482
+ conn_pair : ConnPairApp ,
486
483
writer : & mut impl io:: Write ,
487
484
) -> Result < ( ) , BuyerError > {
488
485
// Get our local public key:
0 commit comments