Skip to content

Commit 168a85b

Browse files
authored
Merge pull request #4498 from collinfunk/hurd-clippy-fixes
Hurd clippy fixes
2 parents 1ba57d4 + 483e331 commit 168a85b

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/unix/hurd/mod.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,12 +1594,12 @@ pub const SEM_VALUE_MAX: c_int = 2147483647;
15941594
pub const MAXNAMLEN: usize = 255;
15951595

15961596
// netdb.h
1597-
pub const _PATH_HEQUIV: &'static [u8; 17usize] = b"/etc/hosts.equiv\0";
1598-
pub const _PATH_HOSTS: &'static [u8; 11usize] = b"/etc/hosts\0";
1599-
pub const _PATH_NETWORKS: &'static [u8; 14usize] = b"/etc/networks\0";
1600-
pub const _PATH_NSSWITCH_CONF: &'static [u8; 19usize] = b"/etc/nsswitch.conf\0";
1601-
pub const _PATH_PROTOCOLS: &'static [u8; 15usize] = b"/etc/protocols\0";
1602-
pub const _PATH_SERVICES: &'static [u8; 14usize] = b"/etc/services\0";
1597+
pub const _PATH_HEQUIV: &[u8; 17usize] = b"/etc/hosts.equiv\0";
1598+
pub const _PATH_HOSTS: &[u8; 11usize] = b"/etc/hosts\0";
1599+
pub const _PATH_NETWORKS: &[u8; 14usize] = b"/etc/networks\0";
1600+
pub const _PATH_NSSWITCH_CONF: &[u8; 19usize] = b"/etc/nsswitch.conf\0";
1601+
pub const _PATH_PROTOCOLS: &[u8; 15usize] = b"/etc/protocols\0";
1602+
pub const _PATH_SERVICES: &[u8; 14usize] = b"/etc/services\0";
16031603
pub const HOST_NOT_FOUND: c_int = 1;
16041604
pub const TRY_AGAIN: c_int = 2;
16051605
pub const NO_RECOVERY: c_int = 3;
@@ -3416,15 +3416,15 @@ const _UTSNAME_LENGTH: usize = 1024;
34163416

34173417
const_fn! {
34183418
{const} fn CMSG_ALIGN(len: usize) -> usize {
3419-
len + mem::size_of::<usize>() - 1 & !(mem::size_of::<usize>() - 1)
3419+
(len + mem::size_of::<usize>() - 1) & !(mem::size_of::<usize>() - 1)
34203420
}
34213421
}
34223422

34233423
// functions
34243424
f! {
34253425
pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
34263426
if (*mhdr).msg_controllen as usize >= mem::size_of::<cmsghdr>() {
3427-
(*mhdr).msg_control as *mut cmsghdr
3427+
(*mhdr).msg_control.cast::<cmsghdr>()
34283428
} else {
34293429
core::ptr::null_mut::<cmsghdr>()
34303430
}
@@ -3453,7 +3453,7 @@ f! {
34533453
{
34543454
core::ptr::null_mut::<cmsghdr>()
34553455
} else {
3456-
next as *mut cmsghdr
3456+
next.cast::<cmsghdr>()
34573457
}
34583458
}
34593459

@@ -3473,14 +3473,12 @@ f! {
34733473
let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
34743474
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
34753475
cpuset.bits[idx] |= 1 << offset;
3476-
()
34773476
}
34783477

34793478
pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
34803479
let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
34813480
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
34823481
cpuset.bits[idx] &= !(1 << offset);
3483-
()
34843482
}
34853483

34863484
pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {

0 commit comments

Comments
 (0)