Skip to content

Commit e2c9bc3

Browse files
committed
---
yaml --- r: 65083 b: refs/heads/master c: ebdb0de h: refs/heads/master i: 65081: 53dbe69 65079: af0e085 v: v3
1 parent 58b99de commit e2c9bc3

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1065a92bf3bbe1f4bb11b7b7268a91529bbf8f89
2+
refs/heads/master: ebdb0dee272829f2410edd51acdb12f20721ce42
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libcore/io.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,25 @@ pub trait Reader {
8484

8585
// FIXME (#2982): This should probably return an error.
8686
/**
87-
* Reads bytes and puts them into `bytes`, advancing the cursor. Returns the
88-
* number of bytes read.
87+
* Reads bytes and puts them into `bytes`. Returns the number of
88+
* bytes read.
8989
*
9090
* The number of bytes to be read is `len` or the end of the file,
9191
* whichever comes first.
9292
*
9393
* The buffer must be at least `len` bytes long.
9494
*
95-
* `read` is conceptually similar to C's `fread`.
96-
*
9795
* # Examples
9896
*
9997
* None right now.
10098
*/
10199
fn read(&self, bytes: &mut [u8], len: uint) -> uint;
102100

103101
/**
104-
* Reads a single byte, advancing the cursor.
102+
* Reads a single byte.
105103
*
106104
* In the case of an EOF or an error, returns a negative value.
107105
*
108-
* `read_byte` is conceptually similar to C's `getc` function.
109-
*
110106
* # Examples
111107
*
112108
* None right now.
@@ -116,8 +112,6 @@ pub trait Reader {
116112
/**
117113
* Returns a boolean value: are we currently at EOF?
118114
*
119-
* `eof` is conceptually similar to C's `feof` function.
120-
*
121115
* # Examples
122116
*
123117
* None right now.
@@ -130,8 +124,6 @@ pub trait Reader {
130124
* Takes an optional SeekStyle, which affects how we seek from the
131125
* position. See `SeekStyle` docs for more details.
132126
*
133-
* `seek` is conceptually similar to C's `fseek`.
134-
*
135127
* # Examples
136128
*
137129
* None right now.
@@ -141,8 +133,6 @@ pub trait Reader {
141133
/**
142134
* Returns the current position within the stream.
143135
*
144-
* `tell` is conceptually similar to C's `ftell` function.
145-
*
146136
* # Examples
147137
*
148138
* None right now.
@@ -1020,6 +1010,16 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
10201010
// top-level functions that take a reader, or a set of default methods on
10211011
// reader (which can then be called reader)
10221012

1013+
/**
1014+
* Gives a `Reader` that allows you to read values from standard input.
1015+
*
1016+
* # Examples
1017+
* ~~~
1018+
* let stdin = core::io::stdin();
1019+
* let line = stdin.read_line();
1020+
* core::io::print(line);
1021+
* ~~~
1022+
*/
10231023
pub fn stdin() -> @Reader {
10241024
unsafe {
10251025
@rustrt::rust_get_stdin() as @Reader

0 commit comments

Comments
 (0)