Skip to content

Commit 3cfe9fc

Browse files
committed
---
yaml --- r: 73246 b: refs/heads/dist-snap c: ebdb0de h: refs/heads/master v: v3
1 parent fbd3dfe commit 3cfe9fc

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 1065a92bf3bbe1f4bb11b7b7268a91529bbf8f89
10+
refs/heads/dist-snap: ebdb0dee272829f2410edd51acdb12f20721ce42
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)