From 77caa39f0c32a6fd7f8746284b177258e90b74c0 Mon Sep 17 00:00:00 2001 From: Wood Date: Sat, 4 Oct 2025 08:44:07 +0800 Subject: [PATCH] fix warns --- src/streaming/common/event_processor.rs | 2 +- src/streaming/event_parser/protocols/pumpswap/types.rs | 2 +- src/streaming/event_parser/protocols/raydium_cpmm/parser.rs | 2 +- src/streaming/grpc/pool.rs | 1 + src/streaming/yellowstone_grpc.rs | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/streaming/common/event_processor.rs b/src/streaming/common/event_processor.rs index 1504180..7d4915e 100644 --- a/src/streaming/common/event_processor.rs +++ b/src/streaming/common/event_processor.rs @@ -349,7 +349,7 @@ impl EventProcessor { match source { EventSource::Grpc => { std::thread::spawn(move || { - let mut worker_threads = + let worker_threads = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(4); // 如果获取失败则回退到4个线程 let rt = tokio::runtime::Builder::new_multi_thread() diff --git a/src/streaming/event_parser/protocols/pumpswap/types.rs b/src/streaming/event_parser/protocols/pumpswap/types.rs index a9d917b..64f6039 100644 --- a/src/streaming/event_parser/protocols/pumpswap/types.rs +++ b/src/streaming/event_parser/protocols/pumpswap/types.rs @@ -6,7 +6,7 @@ use crate::streaming::{ event_parser::{ common::EventMetadata, protocols::pumpswap::{ - parser::PUMPSWAP_PROGRAM_ID, PumpSwapGlobalConfigAccountEvent, PumpSwapPoolAccountEvent, + PumpSwapGlobalConfigAccountEvent, PumpSwapPoolAccountEvent, }, UnifiedEvent, }, diff --git a/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs b/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs index e479aae..cb852a8 100755 --- a/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs +++ b/src/streaming/event_parser/protocols/raydium_cpmm/parser.rs @@ -2,7 +2,7 @@ use solana_sdk::pubkey::Pubkey; use crate::streaming::event_parser::{ common::{read_u64_le, EventMetadata, EventType, ProtocolType}, - core::event_parser::{EventParser, GenericEventParseConfig}, + core::event_parser::GenericEventParseConfig, protocols::raydium_cpmm::{ discriminators, RaydiumCpmmDepositEvent, RaydiumCpmmInitializeEvent, RaydiumCpmmSwapEvent, RaydiumCpmmWithdrawEvent, diff --git a/src/streaming/grpc/pool.rs b/src/streaming/grpc/pool.rs index b95c4c6..c8e6b88 100644 --- a/src/streaming/grpc/pool.rs +++ b/src/streaming/grpc/pool.rs @@ -23,6 +23,7 @@ pub struct PooledObject { } impl PooledObject { + #[allow(dead_code)] fn new(object: Box, pool: Arc>>>, max_size: usize) -> Self { Self { object: Some(object), pool, max_size } } diff --git a/src/streaming/yellowstone_grpc.rs b/src/streaming/yellowstone_grpc.rs index ebd73a6..bc499f3 100644 --- a/src/streaming/yellowstone_grpc.rs +++ b/src/streaming/yellowstone_grpc.rs @@ -196,7 +196,7 @@ impl YellowstoneGrpc { .subscribe_with_account_request(account_filter, event_type_filter.as_ref()); // 订阅事件 - let (mut subscribe_tx, mut stream, subscribe_request) = self + let (subscribe_tx, mut stream, subscribe_request) = self .subscription_manager .subscribe_with_request(transactions, accounts, commitment, event_type_filter.as_ref()) .await?;