From 79b86a7dff071a2a59858d1c98e202fdf38ebd06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ad=C3=A4?= Date: Sat, 24 Feb 2024 05:09:59 +0100 Subject: [PATCH] mmsg revert signature simplification (#2227) --- changelog/2119.changed.md | 1 - src/sys/socket/mod.rs | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 changelog/2119.changed.md diff --git a/changelog/2119.changed.md b/changelog/2119.changed.md deleted file mode 100644 index 88b88fa595..0000000000 --- a/changelog/2119.changed.md +++ /dev/null @@ -1 +0,0 @@ -Simplified the function signatures of `recvmmsg` and `sendmmsg` diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 65a579cd03..3d1651bd3f 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -1499,11 +1499,11 @@ pub fn sendmmsg<'a, XS, AS, C, I, S>( flags: MsgFlags ) -> crate::Result> where - XS: IntoIterator, + XS: IntoIterator, AS: AsRef<[Option]>, - 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; @@ -1650,11 +1650,11 @@ pub fn recvmmsg<'a, XS, S, I>( mut timeout: Option, ) -> crate::Result> where - XS: IntoIterator, - I: AsMut<[IoSliceMut<'a>]>, + XS: IntoIterator, + 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 _;