From 1ffe11cb1f24e97540c20ec8a02a1d07b8f33ffc Mon Sep 17 00:00:00 2001 From: "claude@clouddev1" Date: Mon, 22 Jun 2026 15:07:41 +0000 Subject: [PATCH] fix(tt4): drop the dead `pid` helper so e2e_pty is warning-free off Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `rss_kib` is Linux-only (#[cfg(target_os = "linux")]) and was the sole caller of `pid()`, so on macOS/Windows `pid` was dead code and emitted a `method `pid` is never used` warning. The Linux CI clippy gate never saw it — `pid` is used on Linux — so it only surfaced on a manual macOS run. Read `child.process_id()` inline in `rss_kib` and delete the helper. Verified: macOS `cargo test` is fully green (5 e2e_pty tests there; the Linux-only RSS test is cfg'd out). clippy --all-targets + fmt clean. --- tests/e2e_pty.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/e2e_pty.rs b/tests/e2e_pty.rs index 391b765..1bf9a8e 100644 --- a/tests/e2e_pty.rs +++ b/tests/e2e_pty.rs @@ -233,14 +233,13 @@ impl PtyApp { self.send(b"\r"); } - fn pid(&self) -> Option { - self.child.process_id() - } - - /// Resident set size of the child in KiB (Linux only). + /// Resident set size of the child in KiB (Linux only). `process_id` + /// is read inline here rather than via a helper so the method has no + /// non-Linux callers to go dead (the CI clippy gate runs on Linux, + /// where such dead code wouldn't surface). #[cfg(target_os = "linux")] fn rss_kib(&self) -> Option { - let pid = self.pid()?; + let pid = self.child.process_id()?; let status = std::fs::read_to_string(format!("/proc/{pid}/status")).ok()?; status.lines().find_map(|l| { let rest = l.strip_prefix("VmRSS:")?;