diff --git a/src/auth.rs b/src/auth.rs index c4e15ac..7af12c3 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -26,7 +26,7 @@ const POLY_PASS_HEADER: &str = "poly_passphrase"; type Headers = HashMap<&'static str, String>; -/// EIP-712 struct for CLOB authentication +// EIP-712 struct for CLOB authentication sol! { struct ClobAuth { address address; @@ -36,7 +36,7 @@ sol! { } } -/// EIP-712 struct for order signing +// EIP-712 struct for order signing sol! { struct Order { uint256 salt; diff --git a/src/book.rs b/src/book.rs index 1ebf8e0..7550f2c 100644 --- a/src/book.rs +++ b/src/book.rs @@ -392,6 +392,7 @@ impl OrderBook { /// Otherwise, set the total size at this price level /// /// This converts to fixed-point and calls the fast version + #[allow(dead_code)] fn apply_bid_delta(&mut self, price: Decimal, size: Decimal) { // Convert to fixed-point (this should be rare since we use fast path) let price_ticks = decimal_to_price(price).unwrap_or(0); @@ -403,6 +404,7 @@ impl OrderBook { /// Same logic as bids - size of 0 means remove the price level /// /// This converts to fixed-point and calls the fast version + #[allow(dead_code)] fn apply_ask_delta(&mut self, price: Decimal, size: Decimal) { // Convert to fixed-point (this should be rare since we use fast path) let price_ticks = decimal_to_price(price).unwrap_or(0); @@ -461,7 +463,6 @@ impl OrderBook { /// mostly noise and will never get hit in normal trading /// 4. Stale data: Deep levels often contain old orders that haven't been cancelled /// 5. Network bandwidth: Less data to send when streaming updates - fn trim_depth(&mut self) { // For bids, remove the LOWEST prices (worst bids) if we have too many // Example: If best bid is $0.65, we don't care about bids at $0.10 diff --git a/src/client.rs b/src/client.rs index ee19b21..9373214 100644 --- a/src/client.rs +++ b/src/client.rs @@ -173,7 +173,7 @@ impl ClobClient { /// Test basic connectivity pub async fn get_ok(&self) -> bool { - match self.http_client.get(&format!("{}/ok", self.base_url)).send().await { + match self.http_client.get(format!("{}/ok", self.base_url)).send().await { Ok(response) => response.status().is_success(), Err(_) => false, } @@ -182,7 +182,7 @@ impl ClobClient { /// Get server time pub async fn get_server_time(&self) -> Result { let response = self.http_client - .get(&format!("{}/time", self.base_url)) + .get(format!("{}/time", self.base_url)) .send() .await?; diff --git a/src/decode.rs b/src/decode.rs index 15a4356..a9272df 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -372,7 +372,7 @@ pub fn parse_stream_message(raw: &str) -> Result { .as_str() .and_then(|s| chrono::DateTime::parse_from_rfc3339(s).ok()) .map(|dt| dt.with_timezone(&Utc)) - .unwrap_or_else(|| Utc::now()); + .unwrap_or_else(Utc::now); Ok(StreamMessage::Heartbeat { timestamp }) } _ => Err(PolyfillError::parse( diff --git a/src/fill.rs b/src/fill.rs index 71d002f..2058753 100644 --- a/src/fill.rs +++ b/src/fill.rs @@ -572,7 +572,7 @@ mod tests { // Test basic properties exist (we can't access private fields directly) // But we can test that the engine was created successfully - assert!(true); // Engine creation successful + // Engine creation successful } #[test] diff --git a/src/lib.rs b/src/lib.rs index 17af631..f2d2b6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,8 +142,9 @@ mod benches { use chrono::Utc; use std::str::FromStr; + #[allow(dead_code)] fn order_book_benchmark(c: &mut criterion::Criterion) { - let mut book_manager = OrderBookManager::new(100); + let book_manager = OrderBookManager::new(100); c.bench_function("apply_order_delta", |b| { b.iter(|| { @@ -173,10 +174,10 @@ mod tests { #[test] fn test_client_creation() { - let client = ClobClient::new("https://test.example.com"); + let _client = ClobClient::new("https://test.example.com"); // Test that the client was created successfully // We can't test private fields, but we can verify the client exists - assert!(true); // Client creation successful + // Client creation successful } #[test] diff --git a/src/stream.rs b/src/stream.rs index fea62fa..cc8a347 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -30,6 +30,7 @@ pub trait MarketStream: Stream> + Send + Sync { /// WebSocket-based market stream implementation #[derive(Debug)] +#[allow(dead_code)] pub struct WebSocketStream { /// WebSocket connection connection: Option>>, @@ -219,6 +220,7 @@ impl WebSocketStream { } /// Handle incoming WebSocket messages + #[allow(dead_code)] async fn handle_message(&mut self, message: tokio_tungstenite::tungstenite::Message) -> Result<()> { match message { tokio_tungstenite::tungstenite::Message::Text(text) => { @@ -264,6 +266,7 @@ impl WebSocketStream { } /// Parse Polymarket WebSocket message format + #[allow(dead_code)] fn parse_polymarket_message(&self, text: &str) -> Result { let value: Value = serde_json::from_str(text) .map_err(|e| PolyfillError::parse(format!("Failed to parse WebSocket message: {}", e), Some(Box::new(e))))?; @@ -325,6 +328,7 @@ impl WebSocketStream { } /// Reconnect with exponential backoff + #[allow(dead_code)] async fn reconnect(&mut self) -> Result<()> { let mut delay = self.reconnect_config.base_delay; let mut retries = 0;