From aa8b4bed98f793704757b7732c06c7f2ddd0d4ce Mon Sep 17 00:00:00 2001 From: jimmyfraiture Date: Mon, 22 Sep 2025 13:49:11 +0100 Subject: [PATCH] V3 --- codex-rs/core/src/shell.rs | 4 ++-- codex-rs/linux-sandbox/src/landlock.rs | 2 +- codex-rs/linux-sandbox/tests/suite/landlock.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codex-rs/core/src/shell.rs b/codex-rs/core/src/shell.rs index 1f06f1abe1..cb43dd0ebc 100644 --- a/codex-rs/core/src/shell.rs +++ b/codex-rs/core/src/shell.rs @@ -562,10 +562,10 @@ mod tests_windows { for (shell, input, expected_cmd) in cases { let actual_cmd = shell - .format_default_shell_invocation(input.iter().map(|s| s.to_string()).collect()); + .format_default_shell_invocation(input.iter().map(std::string::ToString::to_string).collect()); assert_eq!( actual_cmd, - Some(expected_cmd.iter().map(|s| s.to_string()).collect()) + Some(expected_cmd.iter().map(std::string::ToString::to_string).collect()) ); } } diff --git a/codex-rs/linux-sandbox/src/landlock.rs b/codex-rs/linux-sandbox/src/landlock.rs index 5bc96130dd..9fdcba66c5 100644 --- a/codex-rs/linux-sandbox/src/landlock.rs +++ b/codex-rs/linux-sandbox/src/landlock.rs @@ -56,7 +56,7 @@ pub(crate) fn apply_sandbox_policy_to_current_thread( /// /// # Errors /// Returns [`CodexErr::Sandbox`] variants when the ruleset fails to apply. -fn install_filesystem_landlock_rules_on_current_thread(writable_roots: Vec) -> Result<()> { +fn install_filesystem_landlock_rules_on_current_thread(writable_roots: &[PathBuf]) -> Result<()> { let abi = ABI::V5; let access_rw = AccessFs::from_all(abi); let access_ro = AccessFs::from_read(abi); diff --git a/codex-rs/linux-sandbox/tests/suite/landlock.rs b/codex-rs/linux-sandbox/tests/suite/landlock.rs index ea4930fada..bf9cdaddd8 100644 --- a/codex-rs/linux-sandbox/tests/suite/landlock.rs +++ b/codex-rs/linux-sandbox/tests/suite/landlock.rs @@ -138,7 +138,7 @@ async fn assert_network_blocked(cmd: &[&str]) { let cwd = std::env::current_dir().expect("cwd should exist"); let sandbox_cwd = cwd.clone(); let params = ExecParams { - command: cmd.iter().map(|s| s.to_string()).collect(), + command: cmd.iter().map(std::string::ToString::to_string).collect(), cwd, // Give the tool a generous 2-second timeout so even slow DNS timeouts // do not stall the suite.