Skip to content

Commit 5d11674

Browse files
committed
Fix style in CMSG_* "macros" for fuchsia
This change addresses two style errors found in PR review: * indent and linebreak in CMSG_NXTHDR * prefer `0 as *mut cmsghdr` over `core::ptr::nul_mut()`
1 parent 5974926 commit 5d11674

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/fuchsia/mod.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -3255,13 +3255,14 @@ f! {
32553255
cmsg.offset(1) as *mut c_uchar
32563256
}
32573257

3258-
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) ->
3259-
*mut cmsghdr {
3258+
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr)
3259+
-> *mut cmsghdr
3260+
{
32603261
if ((*cmsg).cmsg_len as ::size_t) < ::mem::size_of::<cmsghdr>() {
3261-
core::ptr::null_mut()
3262+
0 as *mut cmsghdr
32623263
} else if __CMSG_NEXT(cmsg).add(::mem::size_of::<cmsghdr>())
32633264
>= __MHDR_END(mhdr) {
3264-
core::ptr::null_mut()
3265+
0 as *mut cmsghdr
32653266
} else {
32663267
__CMSG_NEXT(cmsg).cast()
32673268
}
@@ -3271,7 +3272,7 @@ f! {
32713272
if (*mhdr).msg_controllen as ::size_t >= ::mem::size_of::<cmsghdr>() {
32723273
(*mhdr).msg_control.cast()
32733274
} else {
3274-
core::ptr::null_mut()
3275+
0 as *mut cmsghdr
32753276
}
32763277
}
32773278

0 commit comments

Comments
 (0)