MCPcopy Create free account
hub / github.com/PowerShell/DSC / print_json

Function print_json

resources/windows_firewall/src/main.rs:26–34  ·  view source on GitHub ↗
(value: &impl serde::Serialize)

Source from the content-addressed store, hash-verified

24}
25
26fn 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
36fn require_input(input_json: Option<String>) -> FirewallRuleList {
37 let json = match input_json {

Callers 1

mainFunction · 0.70

Calls 2

write_errorFunction · 0.70
to_stringFunction · 0.50

Tested by

no test coverage detected