Skip to content

Commit

Permalink
Don't use Cow::<str>::to_string (#2570)
Browse files Browse the repository at this point in the history
The existing code accidentally dropped the possibly already existing
owned value.
  • Loading branch information
CryZe authored Dec 26, 2024
1 parent 08af3f8 commit e789a7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ifaddrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down

0 comments on commit e789a7c

Please sign in to comment.