Skip to content

Commit 1562db8

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 1562db8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-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: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,12 @@ async fn run_tui_mode(
421421
severity(error),
422422
url("https://github.com/remikalbe/siphon#certificate-setup")
423423
)]
424+
#[allow(unused_assignments)]
424425
struct SanMismatchDiagnostic {
425-
#[allow(unused)]
426426
expected: String,
427-
#[allow(unused)]
428427
presented: Vec<String>,
429428

430429
#[help]
431-
#[allow(unused)]
432430
help: String,
433431
}
434432

@@ -455,31 +453,30 @@ impl std::error::Error for SanMismatchDiagnostic {}
455453
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
456454
#[error("Certificate has expired")]
457455
#[diagnostic(code(siphon::tls::expired), severity(error))]
456+
#[allow(unused_assignments)]
458457
struct ExpiredCertDiagnostic {
459458
#[help]
460-
#[allow(unused)]
461459
help: String,
462460
}
463461

464462
/// Unknown issuer diagnostic
465463
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
466464
#[error("Certificate issuer not trusted")]
467465
#[diagnostic(code(siphon::tls::unknown_issuer), severity(error))]
466+
#[allow(unused_assignments)]
468467
struct UnknownIssuerDiagnostic {
469468
#[help]
470-
#[allow(unused)]
471469
help: String,
472470
}
473471

474472
/// Generic TLS diagnostic for other errors
475473
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
476474
#[error("{message}")]
477475
#[diagnostic(code(siphon::tls::error), severity(error))]
476+
#[allow(unused_assignments)]
478477
struct GenericTlsDiagnostic {
479-
#[allow(unused)]
480478
message: String,
481479
#[help]
482-
#[allow(unused)]
483480
help: String,
484481
}
485482

0 commit comments

Comments
 (0)