]> git.lizzy.rs Git - rust.git/commit
add owned locked stdio handles
authorTaylor Yu <tlyu@mit.edu>
Thu, 1 Jul 2021 23:05:24 +0000 (18:05 -0500)
committerTaylor Yu <tlyu@mit.edu>
Fri, 2 Jul 2021 01:55:46 +0000 (20:55 -0500)
commitb3db5cd46c6941563ae8792cf61160c5793d397a
tree3eb037a57b911769cf6dd27cc1138c7d8c17fa0d
parent868c702d0c9a471a28fb55f0148eb1e3e8b1dcc5
add owned locked stdio handles

Add stderr_locked, stdin_locked, and stdout_locked free functions
to obtain owned locked stdio handles in a single step. Also add
into_lock methods to consume a stdio handle and return an owned
lock. These methods will make it easier to use locked stdio
handles without having to deal with lifetime problems or keeping
bindings to the unlocked handles around.
library/std/src/io/mod.rs
library/std/src/io/stdio.rs
library/std/src/io/stdio/tests.rs