mirror of
https://github.com/floor-licker/polyfill-rs.git
synced 2026-08-20 16:08:07 +00:00
fix: resolve all remaining clippy warnings in examples and benchmarks including unused imports, variables, empty println statements, and enum naming conventions
This commit is contained in:
+8
-15
@@ -185,6 +185,7 @@ pub fn is_price_tick_aligned(decimal: Decimal, tick_size_decimal: Decimal) -> bo
|
||||
|
||||
/// Trading side for orders
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub enum Side {
|
||||
BUY = 0,
|
||||
SELL = 1,
|
||||
@@ -208,6 +209,7 @@ impl Side {
|
||||
|
||||
/// Order type specifications
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub enum OrderType {
|
||||
GTC,
|
||||
FOK,
|
||||
@@ -480,7 +482,7 @@ pub struct Order {
|
||||
}
|
||||
|
||||
/// API credentials for authentication
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
pub struct ApiCredentials {
|
||||
#[serde(rename = "apiKey")]
|
||||
pub api_key: String,
|
||||
@@ -488,16 +490,6 @@ pub struct ApiCredentials {
|
||||
pub passphrase: String,
|
||||
}
|
||||
|
||||
impl Default for ApiCredentials {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
api_key: String::new(),
|
||||
secret: String::new(),
|
||||
passphrase: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Configuration for order creation
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct OrderOptions {
|
||||
@@ -905,16 +897,17 @@ impl BalanceAllowanceParams {
|
||||
}
|
||||
|
||||
/// Asset type enum for balance allowance queries
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub enum AssetType {
|
||||
COLLATERAL,
|
||||
CONDITIONAL,
|
||||
}
|
||||
|
||||
impl ToString for AssetType {
|
||||
fn to_string(&self) -> String {
|
||||
impl std::fmt::Display for AssetType {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
AssetType::COLLATERAL => "COLLATERAL".to_string(),
|
||||
AssetType::CONDITIONAL => "CONDITIONAL".to_string(),
|
||||
AssetType::COLLATERAL => write!(f, "COLLATERAL"),
|
||||
AssetType::CONDITIONAL => write!(f, "CONDITIONAL"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user