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

Function bstr_to_option

resources/windows_firewall/src/firewall.rs:132–139  ·  view source on GitHub ↗
(value: BSTR)

Source from the content-addressed store, hash-verified

130}
131
132fn bstr_to_option(value: BSTR) -> Result<Option<String>, FirewallError> {
133 let text = value.to_string();
134 if text.is_empty() {
135 Ok(None)
136 } else {
137 Ok(Some(text))
138 }
139}
140
141fn native_direction_to_model(direction: NET_FW_RULE_DIRECTION) -> Option<RuleDirection> {
142 if direction == NET_FW_RULE_DIR_IN {

Callers 1

rule_to_modelFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected