firewall: save a to_string call

This commit is contained in:
2026-01-16 16:10:49 +00:00
parent 749bf9a7a7
commit eed72cdec9
+3 -3
View File
@@ -40,9 +40,9 @@ impl Firewall {
unsafe { CoCreateInstance(&NetFwRule, None, CLSCTX_INPROC_SERVER) }?;
unsafe { rule.SetName(&BSTR::from(name)) }?;
match mode {
RuleMode::Executable(exe) => unsafe {
rule.SetApplicationName(&BSTR::from(exe.to_string_lossy().to_string()))
}?,
RuleMode::Executable(exe) => {
unsafe { rule.SetApplicationName(&BSTR::from(exe.to_string_lossy().as_ref())) }?
}
RuleMode::Address(ip) => unsafe { rule.SetRemoteAddresses(&BSTR::from(ip)) }?,
}
match direction {