rust #10

Merged
peperunas merged 127 commits from rust into master 2021-02-18 09:42:16 +00:00
Showing only changes of commit 6ed510f2cc - Show all commits

View File

@ -1,5 +1,5 @@
use std::convert::{TryFrom, TryInto};
use std::error::Error;
use std::fmt::{Debug, Formatter};
use std::str::FromStr;
use std::sync::Arc;
@ -8,8 +8,8 @@ use async_trait::async_trait;
use bitfinex::api::Bitfinex;
use bitfinex::orders::{CancelOrderForm, OrderMeta, OrderResponse};
use bitfinex::ticker::TradingPairTicker;
use futures_retry::{FutureRetry, RetryPolicy, StreamRetryExt};
use futures_util::task::FutureObj;
use futures_retry::{FutureRetry, RetryPolicy};
use log::trace;
use tokio::macros::support::Future;
use tokio::time::Duration;
@ -47,7 +47,7 @@ impl Client {
api_secret,
} => Self {
exchange: Exchange::Bitfinex,
inner: Arc::new(Box::new((BitfinexConnector::new(api_key, api_secret)))),
inner: Arc::new(Box::new(BitfinexConnector::new(api_key, api_secret))),
},
}
}
@ -167,7 +167,7 @@ impl Connector for BitfinexConnector {
BitfinexConnector::handle_small_nonce_error,
)
.await
.map_err(|(e, attempts)| e)?;
.map_err(|(e, _attempts)| e)?;
let positions: Vec<_> = active_positions
.into_iter()
@ -193,7 +193,7 @@ impl Connector for BitfinexConnector {
BitfinexConnector::handle_small_nonce_error,
)
.await
.map_err(|(e, attempts)| e)?;
.map_err(|(e, _attempts)| e)?;
Ok(response.iter().map(Into::into).collect())
}