Skip to content

Commit 36197e9

Browse files
youknowonetgross35
authored andcommitted
fix clippy warnings
(backport <rust-lang#3855>) [ drop change to `.split` that doesn't work with old rustc - Trevor ] (cherry picked from commit a438a21)
1 parent f9aa12d commit 36197e9

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

build.rs

-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ fn rustc_minor_nightly() -> (u32, bool) {
216216
let output = cmd
217217
.arg("--version")
218218
.output()
219-
.ok()
220219
.expect("Failed to get rustc version");
221220
if !output.status.success() {
222221
panic!(

src/unix/bsd/apple/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5564,19 +5564,19 @@ f! {
55645564
return ::CMSG_FIRSTHDR(mhdr);
55655565
};
55665566
let cmsg_len = (*cmsg).cmsg_len as usize;
5567-
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
5567+
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len);
55685568
let max = (*mhdr).msg_control as usize
55695569
+ (*mhdr).msg_controllen as usize;
55705570
if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
5571-
0 as *mut ::cmsghdr
5571+
core::ptr::null_mut()
55725572
} else {
55735573
next as *mut ::cmsghdr
55745574
}
55755575
}
55765576

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

55825582
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {

src/unix/bsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ f! {
548548
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
549549
(*mhdr).msg_control as *mut ::cmsghdr
550550
} else {
551-
0 as *mut ::cmsghdr
551+
core::ptr::null_mut()
552552
}
553553
}
554554

0 commit comments

Comments
 (0)