about summary refs log tree commit diff
path: root/src/libstd/io.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/io.rs')
-rw-r--r--src/libstd/io.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libstd/io.rs b/src/libstd/io.rs
index cef183d0429..153286a311a 100644
--- a/src/libstd/io.rs
+++ b/src/libstd/io.rs
@@ -770,9 +770,10 @@ impl<T:Reader> ReaderUtil for T {
 
     fn read_lines(&self) -> ~[~str] {
         do vec::build |push| {
-            for self.each_line |line| {
+            do self.each_line |line| {
                 push(line.to_owned());
-            }
+                true
+            };
         }
     }
 
@@ -1880,16 +1881,16 @@ mod tests {
 
         {
             let file = io::file_reader(&path).unwrap();
-            for file.each_byte() |_| {
-                fail!("must be empty");
-            }
+            do file.each_byte() |_| {
+                fail!("must be empty")
+            };
         }
 
         {
             let file = io::file_reader(&path).unwrap();
-            for file.each_char() |_| {
-                fail!("must be empty");
-            }
+            do file.each_char() |_| {
+                fail!("must be empty")
+            };
         }
     }