Skip to content

Commit e789a7c

Browse files
authored
Don't use Cow::<str>::to_string (#2570)
The existing code accidentally dropped the possibly already existing owned value.
1 parent 08af3f8 commit e789a7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ifaddrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl InterfaceAddress {
9393
let netmask =
9494
unsafe { SockaddrStorage::from_raw(info.ifa_netmask, None) };
9595
let mut addr = InterfaceAddress {
96-
interface_name: ifname.to_string_lossy().to_string(),
96+
interface_name: ifname.to_string_lossy().into_owned(),
9797
flags: InterfaceFlags::from_bits_truncate(
9898
info.ifa_flags as IflagsType,
9999
),

0 commit comments

Comments
 (0)