diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 7e8f350b8379..dc24cbb01fc8 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -124,14 +124,12 @@ impl Blob { blobPropertyBag: &BlobBinding::BlobPropertyBag) -> Fallible> { // TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView or Blob - // FIXME(ajeffrey): convert directly from a DOMString to a Vec - let bytes: Vec = String::from(blobParts).into_bytes(); let typeString = if is_ascii_printable(&blobPropertyBag.type_) { &*blobPropertyBag.type_ } else { "" }; - Ok(Blob::new(global, bytes, &typeString.to_ascii_lowercase())) + Ok(Blob::new(global, blobParts.into(), &typeString.to_ascii_lowercase())) } pub fn get_data(&self) -> &DataSlice {