]> git.lizzy.rs Git - rust.git/commit
Rewrite `io::BufRead` doc examples to better demonstrate behaviors.
authorCorey Farwell <coreyf@rwell.org>
Sat, 18 Mar 2017 14:37:52 +0000 (10:37 -0400)
committerCorey Farwell <coreyf@rwell.org>
Fri, 24 Mar 2017 03:04:36 +0000 (23:04 -0400)
commit8fba638b08eb85cda1bd2a4e855f7f76727dfc52
tree3b9a40429c08af0647bcdf2e1dd8738c05121caa
parent4853584000c2e71710318b1ff3393b6be25c076a
Rewrite `io::BufRead` doc examples to better demonstrate behaviors.

Prior to this commit, most of the `BufRead` examples used `StdinLock` to
demonstrate how certain `BufRead` methods worked. Using `StdinLock` is
not ideal since:

* Relying on run-time data means we can't show concrete examples of how
  these methods work up-front. The user is required to run them in order
  to see how they behave.
* If the user tries to run an example in the playpen, it won't work
  because the playpen doesn't support user input to stdin.
src/libstd/io/mod.rs