Add a io::Writer wrapper that supports pushback
C's stdio has a function ungetc that lets you push back a single char on a stream. While we could expose support for the c functions, this wouldn't help with our str/bytes writers. Instead, how about we make a trait/impl io::Writer wrapper that supports lookahead and pushback for any io::Writers?
Nominating for Maturity 5, Production Ready
sub-bug of #4248, and a feature
accepted for feature-complete milestone
assigning P-low.
Shouldn't this be an io::Reader wrapper?
Is something like this what everyone has in mind? https://gist.github.com/pongad/9316641 I can open a PR if everyone likes it ok.
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.
This issue has been moved to the RFCs repo: rust-lang/rfcs#856