Skip to content

Commit 65e7837

Browse files
eduardosmtgross35
authored andcommitted
Fix unused_qualifications
1 parent fda6017 commit 65e7837

File tree

3 files changed

+31
-34
lines changed

3 files changed

+31
-34
lines changed

build.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ fn rustc_minor_nightly() -> (u32, bool) {
179179
}
180180

181181
fn which_freebsd() -> Option<i32> {
182-
let output = std::process::Command::new("freebsd-version")
183-
.output()
184-
.ok()?;
182+
let output = Command::new("freebsd-version").output().ok()?;
185183
if !output.status.success() {
186184
return None;
187185
}
@@ -200,10 +198,7 @@ fn which_freebsd() -> Option<i32> {
200198
}
201199

202200
fn emcc_version_code() -> Option<u64> {
203-
let output = std::process::Command::new("emcc")
204-
.arg("-dumpversion")
205-
.output()
206-
.ok()?;
201+
let output = Command::new("emcc").arg("-dumpversion").output().ok()?;
207202
if !output.status.success() {
208203
return None;
209204
}

src/unix/linux_like/linux/mod.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Linux-specific definitions for linux-like values
22
3-
use core::mem;
3+
use core::mem::size_of;
44

55
pub type useconds_t = u32;
66
pub type dev_t = u64;
@@ -3726,15 +3726,15 @@ pub const TP_FT_REQ_FILL_RXHASH: ::__u32 = 1;
37263726

37273727
pub const TPACKET_ALIGNMENT: usize = 16;
37283728

3729-
pub const TPACKET_HDRLEN: usize = ((mem::size_of::<::tpacket_hdr>() + TPACKET_ALIGNMENT - 1)
3729+
pub const TPACKET_HDRLEN: usize = ((size_of::<::tpacket_hdr>() + TPACKET_ALIGNMENT - 1)
37303730
& !(TPACKET_ALIGNMENT - 1))
3731-
+ mem::size_of::<::sockaddr_ll>();
3732-
pub const TPACKET2_HDRLEN: usize = ((mem::size_of::<::tpacket2_hdr>() + TPACKET_ALIGNMENT - 1)
3731+
+ size_of::<::sockaddr_ll>();
3732+
pub const TPACKET2_HDRLEN: usize = ((size_of::<::tpacket2_hdr>() + TPACKET_ALIGNMENT - 1)
37333733
& !(TPACKET_ALIGNMENT - 1))
3734-
+ mem::size_of::<::sockaddr_ll>();
3735-
pub const TPACKET3_HDRLEN: usize = ((mem::size_of::<::tpacket3_hdr>() + TPACKET_ALIGNMENT - 1)
3734+
+ size_of::<::sockaddr_ll>();
3735+
pub const TPACKET3_HDRLEN: usize = ((size_of::<::tpacket3_hdr>() + TPACKET_ALIGNMENT - 1)
37363736
& !(TPACKET_ALIGNMENT - 1))
3737-
+ mem::size_of::<::sockaddr_ll>();
3737+
+ size_of::<::sockaddr_ll>();
37383738

37393739
// linux/netfilter.h
37403740
pub const NF_DROP: ::c_int = 0;
@@ -4198,11 +4198,11 @@ pub const IW_PMKID_CAND_PREAUTH: ::c_ulong = 0x00000001;
41984198
pub const IW_EV_LCP_PK_LEN: usize = 4;
41994199

42004200
pub const IW_EV_CHAR_PK_LEN: usize = 20; // IW_EV_LCP_PK_LEN + ::IFNAMSIZ;
4201-
pub const IW_EV_UINT_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + ::mem::size_of::<u32>();
4202-
pub const IW_EV_FREQ_PK_LEN: usize = 12; // IW_EV_LCP_PK_LEN + ::mem::size_of::<iw_freq>();
4203-
pub const IW_EV_PARAM_PK_LEN: usize = 12; // IW_EV_LCP_PK_LEN + ::mem::size_of::<iw_param>();
4204-
pub const IW_EV_ADDR_PK_LEN: usize = 20; // IW_EV_LCP_PK_LEN + ::mem::size_of::<::sockaddr>();
4205-
pub const IW_EV_QUAL_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + ::mem::size_of::<iw_quality>();
4201+
pub const IW_EV_UINT_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + size_of::<u32>();
4202+
pub const IW_EV_FREQ_PK_LEN: usize = 12; // IW_EV_LCP_PK_LEN + size_of::<iw_freq>();
4203+
pub const IW_EV_PARAM_PK_LEN: usize = 12; // IW_EV_LCP_PK_LEN + size_of::<iw_param>();
4204+
pub const IW_EV_ADDR_PK_LEN: usize = 20; // IW_EV_LCP_PK_LEN + size_of::<::sockaddr>();
4205+
pub const IW_EV_QUAL_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + size_of::<iw_quality>();
42064206
pub const IW_EV_POINT_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + 4;
42074207

42084208
pub const IPTOS_TOS_MASK: u8 = 0x1E;
@@ -5282,9 +5282,9 @@ pub const CANXL_MAX_DLEN: usize = 2048;
52825282
pub const CANXL_XLF: ::c_int = 0x80;
52835283
pub const CANXL_SEC: ::c_int = 0x01;
52845284

5285-
pub const CAN_MTU: usize = ::mem::size_of::<can_frame>();
5286-
pub const CANFD_MTU: usize = ::mem::size_of::<canfd_frame>();
5287-
pub const CANXL_MTU: usize = ::mem::size_of::<canxl_frame>();
5285+
pub const CAN_MTU: usize = size_of::<can_frame>();
5286+
pub const CANFD_MTU: usize = size_of::<canfd_frame>();
5287+
pub const CANXL_MTU: usize = size_of::<canxl_frame>();
52885288
// FIXME(offset_of): use `core::mem::offset_of!` once that is available
52895289
// https://github.com/rust-lang/rfcs/pull/3308
52905290
// pub const CANXL_HDR_SIZE: usize = core::mem::offset_of!(canxl_frame, data);
@@ -5760,17 +5760,17 @@ pub(crate) const fn _IO(ty: u32, nr: u32) -> u32 {
57605760

57615761
/// Build an ioctl number for an read-only ioctl.
57625762
pub(crate) const fn _IOR<T>(ty: u32, nr: u32) -> u32 {
5763-
_IOC(_IOC_READ, ty, nr, core::mem::size_of::<T>())
5763+
_IOC(_IOC_READ, ty, nr, size_of::<T>())
57645764
}
57655765

57665766
/// Build an ioctl number for an write-only ioctl.
57675767
pub(crate) const fn _IOW<T>(ty: u32, nr: u32) -> u32 {
5768-
_IOC(_IOC_WRITE, ty, nr, core::mem::size_of::<T>())
5768+
_IOC(_IOC_WRITE, ty, nr, size_of::<T>())
57695769
}
57705770

57715771
/// Build an ioctl number for a read-write ioctl.
57725772
pub(crate) const fn _IOWR<T>(ty: u32, nr: u32) -> u32 {
5773-
_IOC(_IOC_READ | _IOC_WRITE, ty, nr, core::mem::size_of::<T>())
5773+
_IOC(_IOC_READ | _IOC_WRITE, ty, nr, size_of::<T>())
57745774
}
57755775

57765776
f! {
@@ -5779,7 +5779,7 @@ f! {
57795779
}
57805780

57815781
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
5782-
if ((*cmsg).cmsg_len as usize) < ::mem::size_of::<cmsghdr>() {
5782+
if ((*cmsg).cmsg_len as usize) < size_of::<cmsghdr>() {
57835783
return 0 as *mut cmsghdr;
57845784
};
57855785
let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr;
@@ -5835,7 +5835,7 @@ f! {
58355835
}
58365836

58375837
pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int {
5838-
CPU_COUNT_S(::mem::size_of::<cpu_set_t>(), cpuset)
5838+
CPU_COUNT_S(size_of::<cpu_set_t>(), cpuset)
58395839
}
58405840

58415841
pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {

src/unix/solarish/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use core::mem::size_of;
2+
13
pub type c_char = i8;
24
pub type c_long = i64;
35
pub type c_ulong = u64;
@@ -710,9 +712,9 @@ cfg_if! {
710712
fn data_field_count(&self) -> usize {
711713
match self.si_signo {
712714
::SIGSEGV | ::SIGBUS | ::SIGILL | ::SIGTRAP | ::SIGFPE => {
713-
::mem::size_of::<siginfo_fault>() / ::mem::size_of::<::c_int>()
715+
size_of::<siginfo_fault>() / size_of::<::c_int>()
714716
}
715-
::SIGCLD => ::mem::size_of::<siginfo_sigcld>() / ::mem::size_of::<::c_int>(),
717+
::SIGCLD => size_of::<siginfo_sigcld>() / size_of::<::c_int>(),
716718
::SIGHUP
717719
| ::SIGINT
718720
| ::SIGQUIT
@@ -725,7 +727,7 @@ cfg_if! {
725727
| ::SIGUSR2
726728
| ::SIGPWR
727729
| ::SIGWINCH
728-
| ::SIGURG => ::mem::size_of::<siginfo_kill>() / ::mem::size_of::<::c_int>(),
730+
| ::SIGURG => size_of::<siginfo_kill>() / size_of::<::c_int>(),
729731
_ => SIGINFO_DATA_SIZE,
730732
}
731733
}
@@ -2456,7 +2458,7 @@ const _CMSG_HDR_ALIGNMENT: usize = 8;
24562458
#[cfg(not(target_arch = "sparc64"))]
24572459
const _CMSG_HDR_ALIGNMENT: usize = 4;
24582460

2459-
const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>();
2461+
const _CMSG_DATA_ALIGNMENT: usize = size_of::<::c_int>();
24602462

24612463
const NEWDEV: ::c_int = 1;
24622464

@@ -2483,7 +2485,7 @@ f! {
24832485
}
24842486

24852487
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
2486-
if ((*mhdr).msg_controllen as usize) < ::mem::size_of::<::cmsghdr>() {
2488+
if ((*mhdr).msg_controllen as usize) < size_of::<::cmsghdr>() {
24872489
0 as *mut ::cmsghdr
24882490
} else {
24892491
(*mhdr).msg_control as *mut ::cmsghdr
@@ -2495,7 +2497,7 @@ f! {
24952497
return ::CMSG_FIRSTHDR(mhdr);
24962498
};
24972499
let next = _CMSG_HDR_ALIGN(
2498-
cmsg as usize + (*cmsg).cmsg_len as usize + ::mem::size_of::<::cmsghdr>(),
2500+
cmsg as usize + (*cmsg).cmsg_len as usize + size_of::<::cmsghdr>(),
24992501
);
25002502
let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
25012503
if next > max {
@@ -2506,7 +2508,7 @@ f! {
25062508
}
25072509

25082510
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
2509-
_CMSG_HDR_ALIGN(::mem::size_of::<::cmsghdr>() as usize + length as usize) as ::c_uint
2511+
_CMSG_HDR_ALIGN(size_of::<::cmsghdr>() as usize + length as usize) as ::c_uint
25102512
}
25112513

25122514
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {

0 commit comments

Comments
 (0)