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()) -}