diff options
| author | Lzu Tao <taolzu@gmail.com> | 2020-01-02 08:56:12 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2020-01-02 08:56:12 +0000 |
| commit | dd8f07223346b06da723c25a3ac42f874e6c945c (patch) | |
| tree | 677912d1758b3abbd9cfa00273be1251028cc61f /src/libstd/sys/unix/pipe.rs | |
| parent | 509510152865d5a9a47723ad56047904986c9dd9 (diff) | |
| download | rust-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.rs | 4 |
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); } } |
