From eed72cdec989c1ccfee71a2d1f741f5d231a36c8 Mon Sep 17 00:00:00 2001 From: futile Date: Fri, 16 Jan 2026 16:10:49 +0000 Subject: [PATCH] firewall: save a `to_string` call --- src/util/firewall.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/firewall.rs b/src/util/firewall.rs index 95734b8..e8ba364 100644 --- a/src/util/firewall.rs +++ b/src/util/firewall.rs @@ -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 {