Check if a specific hook command already exists in a matcher list.
(matchers: &[GeminiHookMatcher], matcher_str: &str, command: &str)
| 731 | |
| 732 | /// Check if a specific hook command already exists in a matcher list. |
| 733 | fn hook_command_exists(matchers: &[GeminiHookMatcher], matcher_str: &str, command: &str) -> bool { |
| 734 | matchers |
| 735 | .iter() |
| 736 | .any(|m| m.matcher == matcher_str && m.hooks.iter().any(|h| h.command == command)) |
| 737 | } |
| 738 | |
| 739 | /// Add a hook command to a matcher list, creating the matcher if needed. |
| 740 | fn add_hook_to_matcher( |