diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-10-02 11:48:07 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-10-02 11:48:07 -0700 |
| commit | d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7 (patch) | |
| tree | d39de6be5866c0f0f37f9f3219b8217c873d8b52 /src/libserialize | |
| parent | c0c6c895890770d7029324fd9b592f42e0564e8b (diff) | |
| download | rust-d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7.tar.gz rust-d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7.zip | |
Revert "Use slice syntax instead of slice_to, etc."
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
Diffstat (limited to 'src/libserialize')
| -rw-r--r-- | src/libserialize/json.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 7f329630e70..3007e160bf8 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -334,7 +334,7 @@ pub fn escape_bytes(wr: &mut io::Writer, bytes: &[u8]) -> Result<(), io::IoError }; if start < i { - try!(wr.write(bytes[start..i])); + try!(wr.write(bytes.slice(start, i))); } try!(wr.write_str(escaped)); @@ -343,7 +343,7 @@ pub fn escape_bytes(wr: &mut io::Writer, bytes: &[u8]) -> Result<(), io::IoError } if start != bytes.len() { - try!(wr.write(bytes[start..])); + try!(wr.write(bytes.slice_from(start))); } wr.write_str("\"") @@ -369,7 +369,7 @@ fn spaces(wr: &mut io::Writer, mut n: uint) -> Result<(), io::IoError> { } if n > 0 { - wr.write(buf[..n]) + wr.write(buf.slice_to(n)) } else { Ok(()) } @@ -1149,7 +1149,7 @@ impl Stack { InternalIndex(i) => { Index(i) } InternalKey(start, size) => { Key(str::from_utf8( - self.str_buffer[start as uint .. start as uint + size as uint]).unwrap()) + self.str_buffer.slice(start as uint, start as uint + size as uint)).unwrap()) } } } @@ -1191,7 +1191,7 @@ impl Stack { Some(&InternalIndex(i)) => Some(Index(i)), Some(&InternalKey(start, size)) => { Some(Key(str::from_utf8( - self.str_buffer[start as uint .. (start+size) as uint] + self.str_buffer.slice(start as uint, (start+size) as uint) ).unwrap())) } } |
