Skip to content

Commit a59496c

Browse files
committed
fix: narrow parse_nettop_csv_row_per_pid to macOS-only
The function was gated `cfg(any(macos, test))` while its only caller is macOS-only. On Linux test builds it compiled as dead code, failing `cargo clippy --all-targets -- -D warnings`. Match cfg to caller and drop the now-unused `pub`. Verified via Docker rust:latest container that Linux clippy is clean.
1 parent 5385bf5 commit a59496c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/tunnel_live.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,9 +860,10 @@ fn sample_nettop_per_pid_macos() -> HashMap<u32, (u64, u64)> {
860860
/// Parse one `nettop -P -d -x` CSV row into `(pid, rx_bytes, tx_bytes)`.
861861
/// Returns `None` for header rows, blanks, or rows with too few
862862
/// columns. Mirrors `parse_nettop_csv_row` but does not filter on a
863-
/// specific pid.
864-
#[cfg(any(target_os = "macos", test))]
865-
pub fn parse_nettop_csv_row_per_pid(line: &str) -> Option<(u32, u64, u64)> {
863+
/// specific pid. macOS-only because the only caller is the nettop
864+
/// sampler.
865+
#[cfg(target_os = "macos")]
866+
fn parse_nettop_csv_row_per_pid(line: &str) -> Option<(u32, u64, u64)> {
866867
let line = line.trim();
867868
if line.is_empty() || line.starts_with("time,") {
868869
return None;

0 commit comments

Comments
 (0)