From bdb9f3e26666ef7cd0c3b78e4ddba886d7c49e82 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 12 Jan 2015 17:23:40 +0100 Subject: 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.) --- src/libstd/old_io/mod.rs | 3 ++- src/libstd/old_io/stdio.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstd') 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()); /// } /// ``` -- cgit 1.4.1-3-g733a5