(value: &impl serde::Serialize)
| 24 | } |
| 25 | |
| 26 | fn print_json(value: &impl serde::Serialize) { |
| 27 | match serde_json::to_string(value) { |
| 28 | Ok(json) => println!("{json}"), |
| 29 | Err(error) => { |
| 30 | write_error(&t!("main.invalidJson", error = error.to_string())); |
| 31 | exit(EXIT_FIREWALL_ERROR); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | fn require_input(input_json: Option<String>) -> FirewallRuleList { |
| 37 | let json = match input_json { |
no test coverage detected