Remove as_slice() calls from script.

This commit is contained in:
Ms2ger 2015-04-25 17:05:08 +02:00
parent ef536372cd
commit a862479ca8
42 changed files with 115 additions and 124 deletions

View file

@ -116,10 +116,9 @@ pub trait URLSearchParamsHelpers {
impl URLSearchParamsHelpers for URLSearchParams {
fn serialize(&self, encoding: Option<EncodingRef>) -> Vec<u8> {
// https://url.spec.whatwg.org/#concept-urlencoded-serializer
fn serialize_string(value: &DOMString, encoding: EncodingRef) -> Vec<u8> {
fn serialize_string(value: &str, encoding: EncodingRef) -> Vec<u8> {
// https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer
let value = value.as_slice();
// XXXManishearth should this be a strict encoding? Can unwrap()ing the result fail?
let value = encoding.encode(value, EncoderTrap::Replace).unwrap();