about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/mod.rs6
1 files changed, 3 insertions, 3 deletions
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