Skip to content

Commit be6e332

Browse files
committed
---
yaml --- r: 108522 b: refs/heads/dist-snap c: e61c7fd h: refs/heads/master v: v3
1 parent 4e7f3d5 commit be6e332

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
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 068781e5aa6d2b6af04aeb6c44de4296a5a0b004
9+
refs/heads/dist-snap: e61c7fd3e20d38d7bc55b0ae979fae05744e194f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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

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

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

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