diff options
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r-- | components/script/dom/blob.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index bfecd088bbe..47d03d72082 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -70,12 +70,11 @@ impl Blob { //TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView or Blob let bytes: Option<Vec<u8>> = Some(blobParts.into_bytes()); let typeString = if is_ascii_printable(&blobPropertyBag.type_) { - blobPropertyBag.type_.as_slice() + &*blobPropertyBag.type_ } else { "" }; - let typeStrLower = typeString.as_slice().to_ascii_lowercase(); - Ok(Blob::new(global, bytes, typeStrLower.as_slice())) + Ok(Blob::new(global, bytes, &typeString.to_ascii_lowercase())) } } @@ -121,7 +120,7 @@ impl<'a> BlobMethods for JSRef<'a, Blob> { None => "".to_owned(), Some(str) => { if is_ascii_printable(&str) { - str.as_slice().to_ascii_lowercase().to_owned() + str.to_ascii_lowercase() } else { "".to_owned() } @@ -130,13 +129,13 @@ impl<'a> BlobMethods for JSRef<'a, Blob> { let span: i64 = max(relativeEnd - relativeStart, 0); let global = self.global.root(); match self.bytes { - None => Blob::new(global.r(), None, relativeContentType.as_slice()), + None => Blob::new(global.r(), None, &relativeContentType), Some(ref vec) => { let start = relativeStart.to_usize().unwrap(); let end = (relativeStart + span).to_usize().unwrap(); let mut bytes: Vec<u8> = Vec::new(); bytes.push_all(&vec[start..end]); - Blob::new(global.r(), Some(bytes), relativeContentType.as_slice()) + Blob::new(global.r(), Some(bytes), &relativeContentType) } } } |