Browse Source

剔除警告

hl 1 năm trước cách đây
mục cha
commit
bccc17c4f3

+ 5 - 3
exchanges/src/cointr_swap_rest.rs

@@ -1,15 +1,17 @@
 use std::collections::BTreeMap;
+
+use reqwest::Client;
 // use chrono::Utc;
 use reqwest::header::HeaderMap;
-use reqwest::{Client};
+use ring::hmac;
 use rust_decimal::Decimal;
 use rust_decimal::prelude::FromPrimitive;
 use rust_decimal_macros::dec;
+use serde_json::Value;
 use tracing::{error, info, trace};
+
 use crate::http_tool::RestTool;
 use crate::response_base::ResponseData;
-use ring::hmac;
-use serde_json::{json, Value};
 
 #[derive(Clone, Debug)]
 pub struct CointrSwapRest {

+ 4 - 5
exchanges/src/cointr_swap_ws.rs

@@ -16,7 +16,7 @@ use tokio_tungstenite::tungstenite::{Error, Message};
 use tracing::{error, info, trace};
 
 use crate::response_base::ResponseData;
-use crate::socket_tool::{AbstractWsMode, HeartbeatType};
+use crate::socket_tool::{AbstractWsMode};
 
 pub(crate) static LOGIN_DATA: Lazy<Mutex<(bool, bool)>> = Lazy::new(|| {
     println!("初始化...");
@@ -76,7 +76,7 @@ pub struct CointrSwapWs {
     // 币对
     subscribe_types: Vec<CointrSwapSubscribeType>,
     // 订阅
-    heartbeat_time: u64,                                        // 心跳间隔
+    _heartbeat_time: u64,                                        // 心跳间隔
 }
 
 
@@ -104,7 +104,7 @@ impl CointrSwapWs {
             login_param,
             symbol_s: vec![],
             subscribe_types: vec![],
-            heartbeat_time: 1000 * 5,
+            _heartbeat_time: 1000 * 5,
         }
     }
 
@@ -344,7 +344,7 @@ impl CointrSwapWs {
         let code = json_value["code"].as_i64();
         match code {
             None => {}
-            Some(c) => {
+            Some(_) => {
                 let msg = json_value["msg"].as_str().unwrap();
                 match msg {
                     "connect.success" =>{
@@ -383,7 +383,6 @@ impl CointrSwapWs {
 
 
         let channel = json_value["channel"].as_str();
-        let instId = json_value["instId"].as_str();
         match channel {
             None => {}
             Some(c) => {

+ 1 - 1
exchanges/tests/cointr_swap_test.rs

@@ -7,7 +7,7 @@ use tokio::sync::Mutex;
 use tracing::trace;
 use exchanges::cointr_swap_rest::CointrSwapRest;
 use exchanges::response_base::ResponseData;
-use exchanges::cointr_swap_ws::{CointrSwapLogin, CointrSwapSubscribeType, CointrSwapWs, CointrSwapWsType};
+use exchanges::cointr_swap_ws::{CointrSwapLogin,  CointrSwapWs, CointrSwapWsType};
 
 const ACCESS_KEY: &str = "";
 const SECRET_KEY: &str = "";