From 35a11a7fd7a2b1c6d9caec12dad4d8ab1f23da93 Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Wed, 25 Dec 2024 14:16:11 +0100 Subject: [PATCH] Don't use `Cow::::to_string` The existing code accidentally dropped the possibly already existing owned value. --- src/ifaddrs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifaddrs.rs b/src/ifaddrs.rs index b3de64b01a..991a073e4d 100644 --- a/src/ifaddrs.rs +++ b/src/ifaddrs.rs @@ -93,7 +93,7 @@ impl InterfaceAddress { let netmask = unsafe { SockaddrStorage::from_raw(info.ifa_netmask, None) }; let mut addr = InterfaceAddress { - interface_name: ifname.to_string_lossy().to_string(), + interface_name: ifname.to_string_lossy().into_owned(), flags: InterfaceFlags::from_bits_truncate( info.ifa_flags as IflagsType, ),