diff options
| author | bors <bors@rust-lang.org> | 2014-10-07 06:17:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-07 06:17:11 +0000 |
| commit | e62ef37cfae680e60584731635a89e955121a5bb (patch) | |
| tree | 768fd0552e75e5380b1122ac56448f0465df8fb3 /src/libserialize | |
| parent | 8d702167ba6af50c64683685bae4956cb094a23a (diff) | |
| parent | eb2fdc8b065218476744ed428097c859616c62f0 (diff) | |
auto merge of #17807 : nick29581/rust/slice6, r=aturon
r? @aturon
Diffstat (limited to 'src/libserialize')
| -rw-r--r-- | src/libserialize/json.rs | 10 | ||||
| -rw-r--r-- | src/libserialize/lib.rs | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 654278cf81b..a9ac5ec3ab4 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.slice(start, i))); + try!(wr.write(bytes[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.slice_from(start))); + try!(wr.write(bytes[start..])); } wr.write_str("\"") @@ -371,7 +371,7 @@ fn spaces(wr: &mut io::Writer, mut n: uint) -> Result<(), io::IoError> { } if n > 0 { - wr.write(buf.slice_to(n)) + wr.write(buf[..n]) } else { Ok(()) } @@ -1151,7 +1151,7 @@ impl Stack { InternalIndex(i) => { Index(i) } InternalKey(start, size) => { Key(str::from_utf8( - self.str_buffer.slice(start as uint, start as uint + size as uint)).unwrap()) + self.str_buffer[start as uint .. start as uint + size as uint]).unwrap()) } } } @@ -1193,7 +1193,7 @@ impl Stack { Some(&InternalIndex(i)) => Some(Index(i)), Some(&InternalKey(start, size)) => { Some(Key(str::from_utf8( - self.str_buffer.slice(start as uint, (start+size) as uint) + self.str_buffer[start as uint .. (start+size) as uint] ).unwrap())) } } diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 4213a3e3b72..6de8ca19844 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -23,7 +23,8 @@ Core encoding and decoding interfaces. html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/master/", html_playground_url = "http://play.rust-lang.org/")] -#![feature(macro_rules, default_type_params, phase)] +#![allow(unknown_features)] +#![feature(macro_rules, default_type_params, phase, slicing_syntax)] // test harness access #[cfg(test)] |
