diff options
author | not_a_seagull <notaseagull048@gmail.com> | 2022-01-23 11:43:25 -0800 |
---|---|---|
committer | not_a_seagull <notaseagull048@gmail.com> | 2022-04-08 12:39:16 -0700 |
commit | 0b58f2977252739629b5175043d705f7fc76ea8d (patch) | |
tree | ae028d4613a1c6752fe729e870d4b9ff3c7388b1 /src/sys/sendfile.rs | |
parent | c59a8c8cc6cc6922888d6f33635905f9ea3d3205 (diff) | |
download | nix-0b58f2977252739629b5175043d705f7fc76ea8d.zip |
Replace the IoVec type with IoSlice and IoSliceMut
Diffstat (limited to 'src/sys/sendfile.rs')
-rw-r--r-- | src/sys/sendfile.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sys/sendfile.rs b/src/sys/sendfile.rs index 5ec0b526..2ebcdf48 100644 --- a/src/sys/sendfile.rs +++ b/src/sys/sendfile.rs @@ -68,13 +68,13 @@ cfg_if! { target_os = "freebsd", target_os = "ios", target_os = "macos"))] { - use crate::sys::uio::IoVec; + use std::io::IoSlice; - #[derive(Clone, Debug, Eq, Hash, PartialEq)] + #[derive(Clone, Debug)] struct SendfileHeaderTrailer<'a>( libc::sf_hdtr, - Option<Vec<IoVec<&'a [u8]>>>, - Option<Vec<IoVec<&'a [u8]>>>, + Option<Vec<IoSlice<'a>>>, + Option<Vec<IoSlice<'a>>>, ); impl<'a> SendfileHeaderTrailer<'a> { @@ -82,10 +82,10 @@ cfg_if! { headers: Option<&'a [&'a [u8]]>, trailers: Option<&'a [&'a [u8]]> ) -> SendfileHeaderTrailer<'a> { - let header_iovecs: Option<Vec<IoVec<&[u8]>>> = - headers.map(|s| s.iter().map(|b| IoVec::from_slice(b)).collect()); - let trailer_iovecs: Option<Vec<IoVec<&[u8]>>> = - trailers.map(|s| s.iter().map(|b| IoVec::from_slice(b)).collect()); + let header_iovecs: Option<Vec<IoSlice<'_>>> = + headers.map(|s| s.iter().map(|b| IoSlice::new(b)).collect()); + let trailer_iovecs: Option<Vec<IoSlice<'_>>> = + trailers.map(|s| s.iter().map(|b| IoSlice::new(b)).collect()); SendfileHeaderTrailer( libc::sf_hdtr { headers: { |