Update hyper to 0.12

This commit is contained in:
Bastien Orivel 2018-08-27 18:36:52 +02:00
parent 95bfaa0a77
commit 024b40b39d
122 changed files with 3835 additions and 3448 deletions

View file

@ -22,13 +22,13 @@ use dom::globalscope::GlobalScope;
use dom::progressevent::ProgressEvent;
use dom_struct::dom_struct;
use encoding_rs::{Encoding, UTF_8};
use hyper::mime::{Attr, Mime};
use js::jsapi::Heap;
use js::jsapi::JSAutoCompartment;
use js::jsapi::JSContext;
use js::jsapi::JSObject;
use js::jsval::{self, JSVal};
use js::typedarray::{ArrayBuffer, CreateWith};
use mime::{self, Mime};
use servo_atoms::Atom;
use std::cell::Cell;
use std::ptr;
@ -115,11 +115,10 @@ impl FileReaderSharedFunctionality {
// Step 4 & 5
encoding = encoding.or_else(|| {
let resultmime = blob_type.parse::<Mime>().ok();
resultmime.and_then(|Mime(_, _, ref parameters)| {
parameters
.iter()
.find(|&&(ref k, _)| &Attr::Charset == k)
.and_then(|&(_, ref v)| Encoding::for_label(v.as_str().as_bytes()))
resultmime.and_then(|mime| {
mime.params()
.find(|(ref k, _)| &mime::CHARSET == k)
.and_then(|(_, ref v)| Encoding::for_label(v.as_ref().as_bytes()))
})
});