Skip to content

Commit

Permalink
mmsg revert signature simplification (#2227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan561 authored Feb 24, 2024
1 parent 08e05a5 commit 79b86a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion changelog/2119.changed.md

This file was deleted.

14 changes: 7 additions & 7 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1499,11 +1499,11 @@ pub fn sendmmsg<'a, XS, AS, C, I, S>(
flags: MsgFlags
) -> crate::Result<MultiResults<'a, S>>
where
XS: IntoIterator<Item = I>,
XS: IntoIterator<Item = &'a I>,
AS: AsRef<[Option<S>]>,
I: AsRef<[IoSlice<'a>]>,
C: AsRef<[ControlMessage<'a>]>,
S: SockaddrLike,
I: AsRef<[IoSlice<'a>]> + 'a,
C: AsRef<[ControlMessage<'a>]> + 'a,
S: SockaddrLike + 'a,
{

let mut count = 0;
Expand Down Expand Up @@ -1650,11 +1650,11 @@ pub fn recvmmsg<'a, XS, S, I>(
mut timeout: Option<crate::sys::time::TimeSpec>,
) -> crate::Result<MultiResults<'a, S>>
where
XS: IntoIterator<Item = I>,
I: AsMut<[IoSliceMut<'a>]>,
XS: IntoIterator<Item = &'a mut I>,
I: AsMut<[IoSliceMut<'a>]> + 'a,
{
let mut count = 0;
for (i, (mut slice, mmsghdr)) in slices.into_iter().zip(data.items.iter_mut()).enumerate() {
for (i, (slice, mmsghdr)) in slices.into_iter().zip(data.items.iter_mut()).enumerate() {
let p = &mut mmsghdr.msg_hdr;
p.msg_iov = slice.as_mut().as_mut_ptr().cast();
p.msg_iovlen = slice.as_mut().len() as _;
Expand Down

0 comments on commit 79b86a7

Please sign in to comment.