Remove all Atomic hooks from a matcher list. Preserves non-Atomic hooks. Removes empty matchers (those with no remaining hooks after Atomic hooks are removed).
(matchers: &mut Vec<GeminiHookMatcher>)
| 821 | /// Preserves non-Atomic hooks. Removes empty matchers (those with no |
| 822 | /// remaining hooks after Atomic hooks are removed). |
| 823 | fn remove_atomic_hooks(matchers: &mut Vec<GeminiHookMatcher>) { |
| 824 | for m in matchers.iter_mut() { |
| 825 | m.hooks.retain(|h| !is_atomic_hook(&h.command)); |
| 826 | } |
| 827 | // Remove empty matchers |
| 828 | matchers.retain(|m| !m.hooks.is_empty()); |
| 829 | } |
| 830 | |
| 831 | // Tests |
| 832 |