From 48ba999bd91072797ef9d8568ffb5f868b385c7c Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 18 Jan 2022 15:53:47 +0000 Subject: [PATCH] net_util: drop unneeded clippy::cast_lossless Signed-off-by: Wei Liu --- net_util/src/tap.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/net_util/src/tap.rs b/net_util/src/tap.rs index 83d40a1b4..a4bde2c6b 100644 --- a/net_util/src/tap.rs +++ b/net_util/src/tap.rs @@ -204,7 +204,6 @@ impl Tap { ifreq.ifr_ifru.ifru_addr = addr; // ioctl is safe. Called with a valid sock fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCSIFADDR as c_ulong, &ifreq) }; if ret < 0 { @@ -230,7 +229,6 @@ impl Tap { let mut ifreq = self.get_ifreq(); // ioctl is safe. Called with a valid sock fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCGIFHWADDR as c_ulong, &ifreq) }; if ret < 0 { @@ -245,7 +243,6 @@ impl Tap { } // ioctl is safe. Called with a valid sock fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCSIFHWADDR as c_ulong, &ifreq) }; if ret < 0 { @@ -262,7 +259,6 @@ impl Tap { let ifreq = self.get_ifreq(); // ioctl is safe. Called with a valid sock fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCGIFHWADDR as c_ulong, &ifreq) }; if ret < 0 { @@ -287,7 +283,6 @@ impl Tap { ifreq.ifr_ifru.ifru_addr = addr; // ioctl is safe. Called with a valid sock fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCSIFNETMASK as c_ulong, &ifreq) }; if ret < 0 { @@ -300,7 +295,6 @@ impl Tap { /// Set the offload flags for the tap interface. pub fn set_offload(&self, flags: c_uint) -> Result<()> { // ioctl is safe. Called with a valid tap fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_val(&self.tap_file, net_gen::TUNSETOFFLOAD(), flags as c_ulong) }; if ret < 0 { @@ -316,7 +310,6 @@ impl Tap { let mut ifreq = self.get_ifreq(); - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCGIFFLAGS as c_ulong, &ifreq) }; if ret < 0 { @@ -336,7 +329,6 @@ impl Tap { (net_gen::net_device_flags_IFF_UP | net_gen::net_device_flags_IFF_RUNNING) as i16; // ioctl is safe. Called with a valid sock fd, and we check the return. - #[allow(clippy::cast_lossless)] let ret = unsafe { ioctl_with_ref(&sock, net_gen::sockios::SIOCSIFFLAGS as c_ulong, &ifreq) }; if ret < 0 {