Skip to content

Commit

Permalink
Add docs for stdin in core::io.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed May 19, 2013
1 parent 9f67169 commit a389d86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a389d86

Please sign in to comment.