瀏覽代碼

1.添加coinex http响应body解析json类型定义。2.消除警告

JiahengHe 1 年之前
父節點
當前提交
12f8819414
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 2 1
      exchanges/src/coinex_swap_rest.rs
  2. 0 1
      strategy/src/exchange_disguise.rs

+ 2 - 1
exchanges/src/coinex_swap_rest.rs

@@ -553,7 +553,8 @@ impl CoinexSwapRest {
                 let text_result = response.text().await;
                 match text_result {
                     Ok(text) => {
-                        match serde_json::from_str(text.as_str()) {
+                        let data_json_str: Result<Value, serde_json::Error> = serde_json::from_str(text.as_str());
+                        match data_json_str {
                             Ok(data_json) => {
                                 return if is_success && data_json["code"].to_string() == "0"{
                                     self.on_success_data(data_json["data"].clone())

+ 0 - 1
strategy/src/exchange_disguise.rs

@@ -4,7 +4,6 @@ use std::sync::atomic::AtomicBool;
 use std::time::Duration;
 use rust_decimal::Decimal;
 use tokio::sync::Mutex;
-use tokio::time::Sleep;
 use global::trace_stack::TraceStack;
 use standard::SpecialDepth;