Check if a specific hook command already exists in a matcher list.
(matchers: &[GeminiHookMatcher], matcher_str: &str, command: &str)
| 765 | |
| 766 | /// Check if a specific hook command already exists in a matcher list. |
| 767 | fn hook_command_exists(matchers: &[GeminiHookMatcher], matcher_str: &str, command: &str) -> bool { |
| 768 | matchers |
| 769 | .iter() |
| 770 | .any(|m| m.matcher == matcher_str && m.hooks.iter().any(|h| h.command == command)) |
| 771 | } |
| 772 | |
| 773 | /// Add a hook command to a matcher list, creating the matcher if needed. |
| 774 | fn add_hook_to_matcher( |