about summary refs log tree commit diff
path: root/src/libstd/io/fs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/io/fs.rs')
-rw-r--r--src/libstd/io/fs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index 4691c06c1de..0fffb2fafbe 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -889,7 +889,7 @@ mod test {
             let mut read_buf = [0; 1028];
             let read_str = match check!(read_stream.read(&mut read_buf)) {
                 -1|0 => panic!("shouldn't happen"),
-                n => str::from_utf8(read_buf[..n]).unwrap().to_string()
+                n => str::from_utf8(read_buf.index(&(0..n))).unwrap().to_string()
             };
             assert_eq!(read_str.as_slice(), message);
         }