Skip to content

Commit 97737b2

Browse files
(MAINT) Fix clippy for windows_firewall
1 parent f996add commit 97737b2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

resources/windows_firewall/src/firewall.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,11 @@ fn apply_rule_properties(rule: &INetFwRule, desired: &FirewallRule, existing_pro
272272
// Reject port specifications for protocols that don't support them (e.g. ICMP).
273273
// This must be checked regardless of whether the protocol itself was changed,
274274
// because the caller may only be setting local_ports or remote_ports.
275-
if let Some(protocol) = effective_protocol {
276-
if !protocol_supports_ports(protocol)
277-
&& (desired.local_ports.is_some() || desired.remote_ports.is_some())
278-
{
275+
if let Some(protocol) = effective_protocol
276+
&& !protocol_supports_ports(protocol)
277+
&& (desired.local_ports.is_some() || desired.remote_ports.is_some()) {
279278
return Err(t!("firewall.portsNotAllowed", name = name, protocol = protocol).to_string().into());
280279
}
281-
}
282280

283281
if let Some(protocol) = desired.protocol {
284282
if let Some(current_protocol) = existing_protocol

0 commit comments

Comments
 (0)