Skip to content

Commit 365938f

Browse files
RemiKalbeclaude
andcommitted
fix: resolve clippy warnings
- Add TcpConnectionMap type alias to fix type_complexity warning - Add #[allow(dead_code)] to DnsProvider trait for unused methods - Add #[allow(unused_assignments)] to diagnostic structs for miette derives 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c38a1bd commit 365938f

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

crates/siphon-e2e/src/test_client.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ use siphon_protocol::{ClientMessage, ServerMessage, TunnelCodec, TunnelType};
1919

2020
use crate::harness::TestServer;
2121

22+
/// Type alias for TCP connection registry to avoid clippy::type_complexity
23+
type TcpConnectionMap = Arc<RwLock<HashMap<u64, mpsc::Sender<Vec<u8>>>>>;
24+
2225
/// A test tunnel client
2326
pub struct TestClient {
2427
/// Handle to the spawned client task
@@ -151,8 +154,7 @@ async fn run_client(
151154
let (shutdown_tx, mut shutdown_rx) = mpsc::channel::<()>(1);
152155

153156
// TCP connection state - maps stream_id to writer channel
154-
let tcp_connections: Arc<RwLock<HashMap<u64, mpsc::Sender<Vec<u8>>>>> =
155-
Arc::new(RwLock::new(HashMap::new()));
157+
let tcp_connections: TcpConnectionMap = Arc::new(RwLock::new(HashMap::new()));
156158

157159
// Spawn the main client loop
158160
let tcp_conns = tcp_connections.clone();
@@ -237,7 +239,7 @@ async fn handle_message(
237239
http_client: &reqwest::Client,
238240
local_addr: &str,
239241
response_tx: &mpsc::Sender<ClientMessage>,
240-
tcp_connections: &Arc<RwLock<HashMap<u64, mpsc::Sender<Vec<u8>>>>>,
242+
tcp_connections: &TcpConnectionMap,
241243
) {
242244
match msg {
243245
ServerMessage::HttpRequest {

crates/siphon-server/src/dns_provider.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub enum DnsError {
3131
/// This abstraction allows the server to work with different DNS backends,
3232
/// such as Cloudflare for production or a mock implementation for testing.
3333
#[async_trait]
34+
#[allow(dead_code)]
3435
pub trait DnsProvider: Send + Sync {
3536
/// Create a DNS record for a subdomain
3637
///

crates/siphon/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ async fn run_tui_mode(
422422
url("https://github.com/remikalbe/siphon#certificate-setup")
423423
)]
424424
struct SanMismatchDiagnostic {
425-
#[allow(unused)]
425+
#[allow(unused_assignments)]
426426
expected: String,
427-
#[allow(unused)]
427+
#[allow(unused_assignments)]
428428
presented: Vec<String>,
429429

430430
#[help]
431-
#[allow(unused)]
431+
#[allow(unused_assignments)]
432432
help: String,
433433
}
434434

@@ -457,7 +457,7 @@ impl std::error::Error for SanMismatchDiagnostic {}
457457
#[diagnostic(code(siphon::tls::expired), severity(error))]
458458
struct ExpiredCertDiagnostic {
459459
#[help]
460-
#[allow(unused)]
460+
#[allow(unused_assignments)]
461461
help: String,
462462
}
463463

@@ -467,7 +467,7 @@ struct ExpiredCertDiagnostic {
467467
#[diagnostic(code(siphon::tls::unknown_issuer), severity(error))]
468468
struct UnknownIssuerDiagnostic {
469469
#[help]
470-
#[allow(unused)]
470+
#[allow(unused_assignments)]
471471
help: String,
472472
}
473473

@@ -476,10 +476,10 @@ struct UnknownIssuerDiagnostic {
476476
#[error("{message}")]
477477
#[diagnostic(code(siphon::tls::error), severity(error))]
478478
struct GenericTlsDiagnostic {
479-
#[allow(unused)]
479+
#[allow(unused_assignments)]
480480
message: String,
481481
#[help]
482-
#[allow(unused)]
482+
#[allow(unused_assignments)]
483483
help: String,
484484
}
485485

0 commit comments

Comments
 (0)