From 954dba0c219a92c5ca52af97385d9cb4da252182 Mon Sep 17 00:00:00 2001 From: Jen Tak Date: Fri, 13 Sep 2024 19:18:56 +0200 Subject: [PATCH] Address Brian's review --- wireguard-control/src/backends/userspace.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wireguard-control/src/backends/userspace.rs b/wireguard-control/src/backends/userspace.rs index 7decf5f..befde96 100644 --- a/wireguard-control/src/backends/userspace.rs +++ b/wireguard-control/src/backends/userspace.rs @@ -273,7 +273,8 @@ fn get_userspace_implementation() -> String { } fn start_userspace_wireguard(iface: &InterfaceName) -> io::Result { - let mut command = Command::new(get_userspace_implementation()); + let userspace_implementation = get_userspace_implementation(); + let mut command = Command::new(&userspace_implementation); let output_res = if cfg!(target_os = "linux") { command.args(&[iface.to_string()]).output() @@ -294,7 +295,7 @@ fn start_userspace_wireguard(iface: &InterfaceName) -> io::Result { }, Err(e) if e.kind() == io::ErrorKind::NotFound => Err(io::Error::new( io::ErrorKind::NotFound, - "Cannot find \"wireguard-go\". Specify a custom path with WG_USERSPACE_IMPLEMENTATION.", + format!("Cannot find \"{userspace_implementation}\". Specify a custom path with WG_USERSPACE_IMPLEMENTATION."), )), Err(e) => Err(e), }