From bf5f2f26314ba96752fef4718e5f211fe3f3923d Mon Sep 17 00:00:00 2001 From: Adrien Tétar Date: Sun, 15 Dec 2013 16:19:13 +0100 Subject: doc: forward-port the conditions tutorial + fixup libstd example --- src/libstd/io/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index c5ae6457515..8f0fedfe0db 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -476,9 +476,9 @@ pub trait Reader { /// /// # Example /// - /// let reader = File::open(&Path::new("foo.txt")) - /// while !reader.eof() { - /// println(reader.read_line()); + /// let mut reader = BufferedReader::new(File::open(&Path::new("foo.txt"))); + /// for line in reader.lines() { + /// println(line); /// } /// /// # Failure -- cgit 1.4.1-3-g733a5