auto merge of #6620 : steveklabnik/rust/stdin_docs, r=brson
This commit is contained in:
commit
ebdb0dee27
1 changed files with 10 additions and 0 deletions
|
@ -1010,6 +1010,16 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
|
|||
// top-level functions that take a reader, or a set of default methods on
|
||||
// reader (which can then be called reader)
|
||||
|
||||
/**
|
||||
* Gives a `Reader` that allows you to read values from standard input.
|
||||
*
|
||||
* # Examples
|
||||
* ~~~
|
||||
* let stdin = core::io::stdin();
|
||||
* let line = stdin.read_line();
|
||||
* core::io::print(line);
|
||||
* ~~~
|
||||
*/
|
||||
pub fn stdin() -> @Reader {
|
||||
unsafe {
|
||||
@rustrt::rust_get_stdin() as @Reader
|
||||
|
|
Loading…
Reference in a new issue