diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-01-12 17:23:40 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-02-11 08:50:27 +0100 |
| commit | bdb9f3e26666ef7cd0c3b78e4ddba886d7c49e82 (patch) | |
| tree | f58f208074304e28476afd9922199ab4f5f2ed0c /src/libstd | |
| parent | 5936278ed6bef736f6eb8c0dd4d650fd8e10461b (diff) | |
| download | rust-bdb9f3e26666ef7cd0c3b78e4ddba886d7c49e82.tar.gz rust-bdb9f3e26666ef7cd0c3b78e4ddba886d7c49e82.zip | |
shift bindings to accommodate new lifetime/dtor rules.
(My fix to for-loops (21984) did not deal with similar problems in if-let expressions, so those binding shifts stay.)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/old_io/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/old_io/stdio.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index c3e4e7fc80d..219da8f44eb 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -50,7 +50,8 @@ //! ```rust //! use std::old_io as io; //! -//! for line in io::stdin().lock().lines() { +//! let mut stdin = io::stdin(); +//! for line in stdin.lock().lines() { //! print!("{}", line.unwrap()); //! } //! ``` diff --git a/src/libstd/old_io/stdio.rs b/src/libstd/old_io/stdio.rs index 70400619bea..4b3811bbe38 100644 --- a/src/libstd/old_io/stdio.rs +++ b/src/libstd/old_io/stdio.rs @@ -143,7 +143,8 @@ impl StdinReader { /// ```rust /// use std::old_io; /// - /// for line in old_io::stdin().lock().lines() { + /// let mut stdin = old_io::stdin(); + /// for line in stdin.lock().lines() { /// println!("{}", line.unwrap()); /// } /// ``` |
