Skip to content

Commit eed72cd

Browse files
committed
firewall: save a to_string call
1 parent 749bf9a commit eed72cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/firewall.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ impl Firewall {
4040
unsafe { CoCreateInstance(&NetFwRule, None, CLSCTX_INPROC_SERVER) }?;
4141
unsafe { rule.SetName(&BSTR::from(name)) }?;
4242
match mode {
43-
RuleMode::Executable(exe) => unsafe {
44-
rule.SetApplicationName(&BSTR::from(exe.to_string_lossy().to_string()))
45-
}?,
43+
RuleMode::Executable(exe) => {
44+
unsafe { rule.SetApplicationName(&BSTR::from(exe.to_string_lossy().as_ref())) }?
45+
}
4646
RuleMode::Address(ip) => unsafe { rule.SetRemoteAddresses(&BSTR::from(ip)) }?,
4747
}
4848
match direction {

0 commit comments

Comments
 (0)