Skip to content

Commit a438a21

Browse files
committed
fix clippy warnings
1 parent 5375260 commit a438a21

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ fn rustc_minor_nightly() -> (u32, bool) {
132132
let output = cmd
133133
.arg("--version")
134134
.output()
135-
.ok()
136135
.expect("Failed to get rustc version");
137136
if !output.status.success() {
138137
panic!(
@@ -198,7 +197,7 @@ fn emcc_version_code() -> Option<u64> {
198197

199198
// Some Emscripten versions come with `-git` attached, so split the
200199
// version string also on the `-` char.
201-
let mut pieces = version.trim().split(|c| c == '.' || c == '-');
200+
let mut pieces = version.trim().split(['.', '-']);
202201

203202
let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
204203
let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5508,19 +5508,19 @@ f! {
55085508
return ::CMSG_FIRSTHDR(mhdr);
55095509
};
55105510
let cmsg_len = (*cmsg).cmsg_len as usize;
5511-
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
5511+
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len);
55125512
let max = (*mhdr).msg_control as usize
55135513
+ (*mhdr).msg_controllen as usize;
55145514
if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
5515-
0 as *mut ::cmsghdr
5515+
core::ptr::null_mut()
55165516
} else {
55175517
next as *mut ::cmsghdr
55185518
}
55195519
}
55205520

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

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

src/unix/bsd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ f! {
546546
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
547547
(*mhdr).msg_control as *mut ::cmsghdr
548548
} else {
549-
0 as *mut ::cmsghdr
549+
core::ptr::null_mut()
550550
}
551551
}
552552

0 commit comments

Comments
 (0)