-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::io::{empty, sink} do not replace /dev/null #24235
Comments
I'm personally comfortable with a |
|
Yeah I think this better belongs as an RFC issue nowadays and I haven't heard much of a desire for this recently so we may be covered. |
merge functionality of `io::Sink` into `io::Empty` Many times, there is a need for a simple dummy `io::Read`er + `io::Write`r, but currently the only options are `io::Empty` and `io::Sink` respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This PR adds the functionality of `io::Sink` to `io::Empty`, making `io::Empty` be able to perform the tasks of both of the previous structs. (This idea was first mentioned in rust-lang#24235) Note: I also updated some doc comments in `io::utils` in this pull request to fix inconsistencies between `io::Sink` and `io::Empty`. API Change Proposal: rust-lang/libs-team#49
merge functionality of `io::Sink` into `io::Empty` Many times, there is a need for a simple dummy `io::Read`er + `io::Write`r, but currently the only options are `io::Empty` and `io::Sink` respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This PR adds the functionality of `io::Sink` to `io::Empty`, making `io::Empty` be able to perform the tasks of both of the previous structs. (This idea was first mentioned in rust-lang#24235) Note: I also updated some doc comments in `io::utils` in this pull request to fix inconsistencies between `io::Sink` and `io::Empty`. API Change Proposal: rust-lang/libs-team#49
In particular, splitting up the
Read
andWrite
halves mean that you can't use these in a generic context that expects a full stream (Read + Write
).We should consider deprecating these in favor of a single
null
constructor that is bothRead
andWrite
.The text was updated successfully, but these errors were encountered: