Skip to content

Commit

Permalink
add Clone on PoolPairInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Apr 30, 2024
1 parent d8cd432 commit 1368327
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions json/src/poolpair.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::{HashMap, BTreeMap};
use serde_with::skip_serializing_none;
use serde::{Deserialize, Deserializer};
use serde_json::Value;
use serde_with::skip_serializing_none;
use std::collections::{BTreeMap, HashMap};

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -36,15 +36,15 @@ fn to_float<'de, D: Deserializer<'de>>(deserializer: D) -> std::result::Result<f
Ok(match Value::deserialize(deserializer)? {
Value::String(s) => s.parse::<f64>().ok().unwrap(),
Value::Number(num) => num.as_f64().unwrap_or_default(),
_ => return Err(serde::de::Error::custom("Error parsing"))
_ => return Err(serde::de::Error::custom("Error parsing")),
})
}

#[derive(Debug, Serialize, Deserialize)]
pub struct PoolPairsResult(pub BTreeMap<String, PoolPairInfo>);

#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct PoolPairInfo {
pub symbol: String,
Expand Down

0 comments on commit 1368327

Please sign in to comment.