Skip to content

Commit 70985e5

Browse files
skeptomaiclaude
andcommitted
fix: gate shell_escape and pelagos_cmd mut on cfg(target_os = "macos")
Clippy on Linux flagged unused-mut in pelagos_cmd (cmd is only mutated in the macos branch) and dead-code on shell_escape (only called in the macos branch of open_in_terminal). Restructure both to use cfg blocks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3a02324 commit 70985e5

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/main.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,17 @@ fn run_loop(
395395
/// Build a `pelagos` Command pre-loaded with `--profile <p>` on macOS.
396396
/// On Linux, pelagos has no `--profile` flag — profile isolation is macOS-only.
397397
fn pelagos_cmd(profile: &str) -> std::process::Command {
398-
let mut cmd = std::process::Command::new("pelagos");
399398
#[cfg(target_os = "macos")]
400-
cmd.arg("--profile").arg(profile);
399+
{
400+
let mut cmd = std::process::Command::new("pelagos");
401+
cmd.arg("--profile").arg(profile);
402+
cmd
403+
}
401404
#[cfg(not(target_os = "macos"))]
402-
let _ = profile;
403-
cmd
405+
{
406+
let _ = profile;
407+
std::process::Command::new("pelagos")
408+
}
404409
}
405410

406411
// ---------------------------------------------------------------------------
@@ -928,6 +933,7 @@ fn escape_applescript(s: &str) -> String {
928933
s.replace('\\', "\\\\").replace('"', "\\\"")
929934
}
930935

936+
#[cfg(target_os = "macos")]
931937
fn shell_escape(s: &str) -> String {
932938
format!("'{}'", s.replace('\'', "'\\''"))
933939
}

0 commit comments

Comments
 (0)