Skip to content

Commit

Permalink
remove useless parentheses + clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
qdeconinck committed Jan 10, 2024
1 parent f68a31a commit 533abc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/src/cmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<'a> Encoder<'a> {
let space =
unsafe { libc::CMSG_SPACE(mem::size_of_val(&value) as _) as usize };
assert!(
self.hdr.msg_controllen as usize >= self.len + space,
self.hdr.msg_controllen >= self.len + space,
"control message buffer too small"
);
let cmsg = self.cmsg.take().expect("no control buffer space remaining");
Expand Down Expand Up @@ -107,7 +107,7 @@ impl<'a> Drop for Encoder<'a> {
pub unsafe fn decode<T: Copy>(cmsg: &libc::cmsghdr) -> T {
assert!(mem::align_of::<T>() <= mem::align_of::<libc::cmsghdr>());
debug_assert_eq!(
cmsg.cmsg_len as usize,
cmsg.cmsg_len,
libc::CMSG_LEN(mem::size_of::<T>() as _) as usize
);
ptr::read(libc::CMSG_DATA(cmsg) as *const T)
Expand Down
2 changes: 1 addition & 1 deletion apps/src/recvfrom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn recvmsg(
let mut iov = IoSliceMut::new(buf);
let mut name = MaybeUninit::<libc::sockaddr_storage>::uninit();
let mut ctrl = cmsg::Aligned(MaybeUninit::<
[u8; (std::mem::size_of::<libc::in6_pktinfo>() as _)],
[u8; std::mem::size_of::<libc::in6_pktinfo>() as _],
>::uninit());
let mut hdr = unsafe { std::mem::zeroed::<libc::msghdr>() };

Expand Down

0 comments on commit 533abc1

Please sign in to comment.