From 047afc3467dfc2aaf6dfb588cc801007eaeea26a Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 30 Jul 2026 23:07:17 +0000 Subject: [PATCH] Say why the Darwin socket tuning module allows dead code Its header said the tuning was dormant, and that the module was kept visible on Linux so clippy would not lose track of it. Both claims are false: apply_udp_socket_tuning is called from the connected-peer socket opener under cfg(macos), and the module declaration is itself gated to macOS, so it is not compiled on Linux at all. Unlike the two sibling modules, this allowance stays, because here it is doing real work: the module defines the whole NET_SERVICE_TYPE table for reference and selects only OAM, which leaves eight constants deliberately unreferenced. The comment now says so, which is the justification the attribute was missing. --- src/transport/udp/darwin_sockopts.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transport/udp/darwin_sockopts.rs b/src/transport/udp/darwin_sockopts.rs index 3d6c2f6..c0f8b75 100644 --- a/src/transport/udp/darwin_sockopts.rs +++ b/src/transport/udp/darwin_sockopts.rs @@ -1,6 +1,6 @@ -// Applied at `ConnectedPeerSocket::open` (dormant in this PR; see -// `connected_peer.rs`). Linux toolchain only checks gates — keep -// the module visible on Linux so clippy doesn't lose track. +// Applied at `ConnectedPeerSocket::open`. The full `NET_SERVICE_TYPE_*` +// table is kept for reference although only `OAM` is selected, so most +// of these constants are deliberately unreferenced. #![allow(dead_code)] //! Darwin UDP socket tuning.