(group: &Value, command: &str)
| 524 | } |
| 525 | |
| 526 | fn group_has_command(group: &Value, command: &str) -> bool { |
| 527 | group |
| 528 | .get("hooks") |
| 529 | .and_then(Value::as_array) |
| 530 | .is_some_and(|hooks| { |
| 531 | hooks.iter().any(|hook| { |
| 532 | hook.get("command") |
| 533 | .and_then(Value::as_str) |
| 534 | .is_some_and(|cmd| cmd == command) |
| 535 | }) |
| 536 | }) |
| 537 | } |
| 538 | |
| 539 | fn group_has_hook_spec( |
| 540 | group: &Value, |
no test coverage detected