From 615a027a18cd29f7790c0b5acd7c68ef9e1570b7 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Wed, 12 Nov 2025 18:53:29 -0500 Subject: [PATCH] further cleanup --- codex-rs/execpolicy2/src/rule.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/codex-rs/execpolicy2/src/rule.rs b/codex-rs/execpolicy2/src/rule.rs index 165e0a960e..a1290a4c25 100644 --- a/codex-rs/execpolicy2/src/rule.rs +++ b/codex-rs/execpolicy2/src/rule.rs @@ -113,7 +113,8 @@ impl PrefixRule { if self.matches(example).is_some() { return Err(Error::ExampleDidMatch { rule: format!("{self:?}"), - example: join_command(example), + example: try_join(example.iter().map(String::as_str)) + .unwrap_or_else(|_| "unable to render example".to_string()), }); } } @@ -152,8 +153,3 @@ impl Rule { } } } - -fn join_command(command: &[String]) -> String { - try_join(command.iter().map(String::as_str)) - .unwrap_or_else(|_| "unable to render example".to_string()) -}