(
hook: &Value,
command: &str,
status_message: Option<&str>,
timeout_sec: Option<u64>,
)
| 553 | } |
| 554 | |
| 555 | fn hook_matches_spec( |
| 556 | hook: &Value, |
| 557 | command: &str, |
| 558 | status_message: Option<&str>, |
| 559 | timeout_sec: Option<u64>, |
| 560 | ) -> bool { |
| 561 | if hook.get("command").and_then(Value::as_str) != Some(command) { |
| 562 | return false; |
| 563 | } |
| 564 | if let Some(message) = status_message { |
| 565 | if hook.get("statusMessage").and_then(Value::as_str) != Some(message) { |
| 566 | return false; |
| 567 | } |
| 568 | } |
| 569 | if let Some(timeout) = timeout_sec { |
| 570 | if hook.get("timeout").and_then(Value::as_u64) != Some(timeout) { |
| 571 | return false; |
| 572 | } |
| 573 | } |
| 574 | true |
| 575 | } |
| 576 | |
| 577 | /// Remove only obsolete Atomic hooks for one event, preserving custom hooks |
| 578 | /// and the exact current Atomic definition. This lets a normal `enable` |
no test coverage detected