Replaced DOMString constructor by conversion functions.

Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
This commit is contained in:
Alan Jeffrey 2015-11-11 16:26:53 -06:00
parent 736323a779
commit 84bde75b42
64 changed files with 256 additions and 254 deletions

View file

@ -60,7 +60,8 @@ impl Blob {
pub fn Constructor_(global: GlobalRef, blobParts: DOMString,
blobPropertyBag: &BlobBinding::BlobPropertyBag) -> Fallible<Root<Blob>> {
//TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView or Blob
let bytes: Option<Vec<u8>> = Some(blobParts.0.into_bytes());
// FIXME(ajeffrey): convert directly from a DOMString to a Vec<u8>
let bytes: Option<Vec<u8>> = Some(String::from(blobParts).into_bytes());
let typeString = if is_ascii_printable(&blobPropertyBag.type_) {
&*blobPropertyBag.type_
} else {
@ -90,7 +91,7 @@ impl BlobMethods for Blob {
// https://dev.w3.org/2006/webapi/FileAPI/#dfn-type
fn Type(&self) -> DOMString {
DOMString(self.typeString.clone())
DOMString::from(self.typeString.clone())
}
// https://dev.w3.org/2006/webapi/FileAPI/#slice-method-algo