diff options
Diffstat (limited to 'src/libstd/io/mod.rs')
| -rw-r--r-- | src/libstd/io/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 2595a3c44a8..c71ab514695 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -236,7 +236,7 @@ use int; use iter::{Iterator, IteratorExt}; use marker::Sized; use mem::transmute; -use ops::{FnOnce, Index}; +use ops::FnOnce; use option::Option; use option::Option::{Some, None}; use os; @@ -1069,7 +1069,7 @@ pub trait Writer { fn write_char(&mut self, c: char) -> IoResult<()> { let mut buf = [0u8; 4]; let n = c.encode_utf8(buf.as_mut_slice()).unwrap_or(0); - self.write(buf.index(&(0..n))) + self.write(&buf[0..n]) } /// Write the result of passing n through `int::to_str_bytes`. @@ -1454,7 +1454,7 @@ pub trait Buffer: Reader { }; match available.iter().position(|&b| b == byte) { Some(i) => { - res.push_all(available.index(&(0..(i + 1)))); + res.push_all(&available[0..(i + 1)]); used = i + 1; break } @@ -1493,7 +1493,7 @@ pub trait Buffer: Reader { } } } - match str::from_utf8(buf.index(&(0..width))).ok() { + match str::from_utf8(&buf[0..width]).ok() { Some(s) => Ok(s.char_at(0)), None => Err(standard_error(InvalidInput)) } |
