about summary refs log tree commit diff
path: root/src/libstd/sys/unix/pipe.rs
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2020-01-02 08:56:12 +0000
committerLzu Tao <taolzu@gmail.com>2020-01-02 08:56:12 +0000
commitdd8f07223346b06da723c25a3ac42f874e6c945c (patch)
tree677912d1758b3abbd9cfa00273be1251028cc61f /src/libstd/sys/unix/pipe.rs
parent509510152865d5a9a47723ad56047904986c9dd9 (diff)
downloadrust-dd8f07223346b06da723c25a3ac42f874e6c945c.tar.gz
rust-dd8f07223346b06da723c25a3ac42f874e6c945c.zip
Use drop instead of the toilet closure `|_| ()`
Diffstat (limited to 'src/libstd/sys/unix/pipe.rs')
-rw-r--r--src/libstd/sys/unix/pipe.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs
index 77fefef8a18..2a861c87801 100644
--- a/src/libstd/sys/unix/pipe.rs
+++ b/src/libstd/sys/unix/pipe.rs
@@ -99,11 +99,11 @@ pub fn read2(p1: AnonPipe, v1: &mut Vec<u8>, p2: AnonPipe, v2: &mut Vec<u8>) ->
 
         if fds[0].revents != 0 && read(&p1, v1)? {
             p2.set_nonblocking(false)?;
-            return p2.read_to_end(v2).map(|_| ());
+            return p2.read_to_end(v2).map(drop);
         }
         if fds[1].revents != 0 && read(&p2, v2)? {
             p1.set_nonblocking(false)?;
-            return p1.read_to_end(v1).map(|_| ());
+            return p1.read_to_end(v1).map(drop);
         }
     }