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.
This commit is contained in:
Johnathan Corgan
2026-07-30 23:07:17 +00:00
parent fdc1e7dfca
commit 047afc3467
+3 -3
View File
@@ -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.