(group: &Value, command: &str)
| 457 | } |
| 458 | |
| 459 | fn group_has_command(group: &Value, command: &str) -> bool { |
| 460 | group |
| 461 | .get("hooks") |
| 462 | .and_then(Value::as_array) |
| 463 | .is_some_and(|hooks| { |
| 464 | hooks.iter().any(|hook| { |
| 465 | hook.get("command") |
| 466 | .and_then(Value::as_str) |
| 467 | .is_some_and(|cmd| cmd == command) |
| 468 | }) |
| 469 | }) |
| 470 | } |
| 471 | |
| 472 | fn remove_atomic_hooks(hooks: &mut Map<String, Value>) { |
| 473 | for value in hooks.values_mut() { |
no test coverage detected