mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Replace use of rustc_serialize::base64 by base64
This commit is contained in:
parent
c2d9f663af
commit
0ed4df28b5
12 changed files with 30 additions and 34 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use base64;
|
||||
use dom::bindings::cell::DOMRefCell;
|
||||
use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
|
||||
use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
|
||||
|
@ -29,7 +30,6 @@ use js::jsapi::JSAutoCompartment;
|
|||
use js::jsapi::JSContext;
|
||||
use js::jsval::{self, JSVal};
|
||||
use js::typedarray::{ArrayBuffer, CreateWith};
|
||||
use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64};
|
||||
use script_thread::RunnableWrapper;
|
||||
use servo_atoms::Atom;
|
||||
use std::cell::Cell;
|
||||
|
@ -247,13 +247,7 @@ impl FileReader {
|
|||
|
||||
//https://w3c.github.io/FileAPI/#dfn-readAsDataURL
|
||||
fn perform_readasdataurl(result: &DOMRefCell<Option<FileReaderResult>>, data: ReadMetaData, bytes: &[u8]) {
|
||||
let config = Config {
|
||||
char_set: CharacterSet::UrlSafe,
|
||||
newline: Newline::LF,
|
||||
pad: true,
|
||||
line_length: None
|
||||
};
|
||||
let base64 = bytes.to_base64(config);
|
||||
let base64 = base64::encode(bytes);
|
||||
|
||||
let output = if data.blobtype.is_empty() {
|
||||
format!("data:base64,{}", base64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue