(
hook: &Value,
command: &str,
status_message: Option<&str>,
timeout_sec: Option<u64>,
)
| 539 | } |
| 540 | |
| 541 | fn hook_matches_spec( |
| 542 | hook: &Value, |
| 543 | command: &str, |
| 544 | status_message: Option<&str>, |
| 545 | timeout_sec: Option<u64>, |
| 546 | ) -> bool { |
| 547 | if hook.get("command").and_then(Value::as_str) != Some(command) { |
| 548 | return false; |
| 549 | } |
| 550 | if let Some(message) = status_message { |
| 551 | if hook.get("statusMessage").and_then(Value::as_str) != Some(message) { |
| 552 | return false; |
| 553 | } |
| 554 | } |
| 555 | if let Some(timeout) = timeout_sec { |
| 556 | if hook.get("timeout").and_then(Value::as_u64) != Some(timeout) { |
| 557 | return false; |
| 558 | } |
| 559 | } |
| 560 | true |
| 561 | } |
| 562 | |
| 563 | /// Remove only obsolete Atomic hooks for one event, preserving custom hooks |
| 564 | /// and the exact current Atomic definition. This lets a normal `enable` |
no test coverage detected