about summary refs log tree commit diff
path: root/src/libstd/sys/redox/net
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2019-02-11 19:31:37 -0800
committerSteven Fackler <sfackler@gmail.com>2019-02-13 19:40:17 -0800
commit596f18201c7863d8b02fe6fa1872cf3ba2b6b381 (patch)
tree1b152d89591c590eb92bf1b18591836e88ccf347 /src/libstd/sys/redox/net
parent31bcec648aa57391115f877a2ca022d7ff6415aa (diff)
downloadrust-596f18201c7863d8b02fe6fa1872cf3ba2b6b381.tar.gz
rust-596f18201c7863d8b02fe6fa1872cf3ba2b6b381.zip
impl Deref/DerefMut for IoVec types
Returning &'a mut [u8] was unsound, and we may as well just have them
directly deref to their slices to make it easier to work with them.
Diffstat (limited to 'src/libstd/sys/redox/net')
-rw-r--r--src/libstd/sys/redox/net/tcp.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/redox/net/tcp.rs b/src/libstd/sys/redox/net/tcp.rs
index 08e12dc1ab1..4396a6f963c 100644
--- a/src/libstd/sys/redox/net/tcp.rs
+++ b/src/libstd/sys/redox/net/tcp.rs
@@ -35,7 +35,7 @@ impl TcpStream {
     }
 
     pub fn read_vectored(&self, buf: &mut [IoVecMut<'_>]) -> io::Result<usize> {
-        match buf.iter_mut().map(|b| b.as_mut_slice()).find(|b| !b.is_empty()) {
+        match buf.iter_mut().find(|b| !b.is_empty()) {
             Some(buf) => self.read(buf),
             None => Ok(0),
         }
@@ -46,7 +46,7 @@ impl TcpStream {
     }
 
     pub fn write_vectored(&self, bufs: &[IoVec<'_>]) -> io::Result<usize> {
-        match buf.iter().map(|b| b.as_slice()).find(|b| !b.is_empty()) {
+        match buf.iter().find(|b| !b.is_empty()) {
             Some(buf) => self.write(buf),
             None => Ok(0),
         }