Skip to content

Commit aa071e8

Browse files
committed
---
yaml --- r: 102055 b: refs/heads/master c: e61c7fd h: refs/heads/master i: 102053: 6b836e5 102051: 31249dc 102047: 219d7a4 v: v3
1 parent b3da83c commit aa071e8

File tree

5 files changed

+13
-23
lines changed

5 files changed

+13
-23
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: 068781e5aa6d2b6af04aeb6c44de4296a5a0b004
2+
refs/heads/master: e61c7fd3e20d38d7bc55b0ae979fae05744e194f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/libstd/io/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ Some examples of obvious things you might want to do
2626
* Read lines from stdin
2727
2828
```rust
29-
use std::io;
29+
use std::io::BufferedReader;
30+
use std::io::stdin;
3031
31-
for line in io::stdin().lines() {
32+
let mut stdin = BufferedReader::new(stdin());
33+
for line in stdin.lines() {
3234
print!("{}", line);
3335
}
3436
```
@@ -1095,9 +1097,10 @@ pub trait Buffer: Reader {
10951097
/// # Example
10961098
///
10971099
/// ```rust
1098-
/// use std::io;
1100+
/// use std::io::{BufferedReader, stdin};
1101+
///
1102+
/// let mut reader = BufferedReader::new(stdin());
10991103
///
1100-
/// let mut reader = io::stdin();
11011104
/// let input = reader.read_line().ok().unwrap_or(~"nothing");
11021105
/// ```
11031106
///

trunk/src/libstd/io/stdio.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ out.write(bytes!("Hello, world!"));
3030
use container::Container;
3131
use fmt;
3232
use io::{Reader, Writer, IoResult, IoError, OtherIoError,
33-
standard_error, EndOfFile, LineBufferedWriter, BufferedReader};
33+
standard_error, EndOfFile, LineBufferedWriter};
3434
use libc;
3535
use mem::replace;
3636
use option::{Option, Some, None};
@@ -86,21 +86,8 @@ fn src<T>(fd: libc::c_int, readable: bool, f: |StdSource| -> T) -> T {
8686

8787
/// Creates a new non-blocking handle to the stdin of the current process.
8888
///
89-
/// The returned handled is buffered by default with a `BufferedReader`. If
90-
/// buffered access is not desired, the `stdin_raw` function is provided to
91-
/// provided unbuffered access to stdin.
92-
///
93-
/// See `stdout()` for more notes about this function.
94-
pub fn stdin() -> BufferedReader<StdReader> {
95-
BufferedReader::new(stdin_raw())
96-
}
97-
98-
/// Creates a new non-blocking handle to the stdin of the current process.
99-
///
100-
/// Unlike `stdin()`, the returned reader is *not* a buffered reader.
101-
///
102-
/// See `stdout()` for more notes about this function.
103-
pub fn stdin_raw() -> StdReader {
89+
/// See `stdout()` for notes about this function.
90+
pub fn stdin() -> StdReader {
10491
src(libc::STDIN_FILENO, true, |src| StdReader { inner: src })
10592
}
10693

trunk/src/llvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f5f1ffea207b6b380127ff34f14015ae005d1413
1+
Subproject commit b015ecddd3129490fa26e5278a1acee79f2ee5ef

trunk/src/test/bench/sudoku.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ fn main() {
278278
let mut sudoku = if use_default {
279279
Sudoku::from_vec(&DEFAULT_SUDOKU)
280280
} else {
281-
Sudoku::read(io::stdin())
281+
Sudoku::read(BufferedReader::new(io::stdin()))
282282
};
283283
sudoku.solve();
284284
sudoku.write(&mut io::stdout());

0 commit comments

Comments
 (0)