diff --git a/src/form_urlencoded.rs b/src/form_urlencoded.rs index 6e177e06c..377e29bee 100644 --- a/src/form_urlencoded.rs +++ b/src/form_urlencoded.rs @@ -51,7 +51,7 @@ pub fn parse_bytes(input: &[u8], encoding_override: Option, } } else { let (name, value) = match piece.position_elem(&b'=') { - Some(position) => (piece.slice_to(position), piece.slice_from(position + 1)), + Some(position) => (piece[..position], piece[position + 1..]), None => if isindex { ([].as_slice(), piece) } else { (piece, [].as_slice()) } }; let name = replace_plus(name); diff --git a/src/lib.rs b/src/lib.rs index f41fd2166..1ca5e61a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,8 +116,8 @@ assert!(css_url.serialize() == "http://servo.github.io/rust-url/main.css".to_str */ - #![feature(macro_rules, default_type_params)] +#![feature(slicing_syntax)] extern crate encoding; extern crate serialize; @@ -991,7 +991,7 @@ impl FromUrlPath for path::windows::Path { return Err(()) } let mut bytes = prefix.as_bytes().to_vec(); - for path_part in path.slice_from(1).iter() { + for path_part in path[1..].iter() { bytes.push(b'\\'); percent_decode_to(path_part.as_bytes(), &mut bytes); }