From 663e42bdbd8999dee4fe024c79588ec42e2fbe81 Mon Sep 17 00:00:00 2001 From: Saurav Sachidanand Date: Fri, 11 Mar 2016 17:14:57 +0530 Subject: [PATCH] Convert directly from DOMString to Vec --- components/script/dom/blob.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 7e8f350b837..dc24cbb01fc 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 {