Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
(backport <rust-lang#3855>)
[ drop change to `.split` that doesn't work with old rustc - Trevor ]
(cherry picked from commit a438a21)
  • Loading branch information
youknowone authored and tgross35 committed Aug 28, 2024
1 parent f9aa12d commit 36197e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ fn rustc_minor_nightly() -> (u32, bool) {
let output = cmd
.arg("--version")
.output()
.ok()
.expect("Failed to get rustc version");
if !output.status.success() {
panic!(
Expand Down
6 changes: 3 additions & 3 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5564,19 +5564,19 @@ f! {
return ::CMSG_FIRSTHDR(mhdr);
};
let cmsg_len = (*cmsg).cmsg_len as usize;
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len);
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
0 as *mut ::cmsghdr
core::ptr::null_mut()
} else {
next as *mut ::cmsghdr
}
}

pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar)
.offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize)
.add(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()))
}

pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ f! {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
(*mhdr).msg_control as *mut ::cmsghdr
} else {
0 as *mut ::cmsghdr
core::ptr::null_mut()
}
}

Expand Down

0 comments on commit 36197e9

Please sign in to comment.