mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove some usage of rust-encoding
This commit is contained in:
parent
b0c7c71729
commit
6ac106ca76
7 changed files with 8 additions and 22 deletions
|
@ -9,8 +9,6 @@
|
|||
use actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use devtools_traits::HttpRequest as DevtoolsHttpRequest;
|
||||
use devtools_traits::HttpResponse as DevtoolsHttpResponse;
|
||||
use encoding::all::UTF_8;
|
||||
use encoding::types::{DecoderTrap, Encoding};
|
||||
use hyper::header::{ContentType, Cookie};
|
||||
use hyper::header::Headers;
|
||||
use hyper::http::RawStatus;
|
||||
|
@ -361,7 +359,7 @@ impl NetworkEventActor {
|
|||
pub fn add_response(&mut self, response: DevtoolsHttpResponse) {
|
||||
self.response.headers = response.headers.clone();
|
||||
self.response.status = response.status.as_ref().map(|&(s, ref st)| {
|
||||
let status_text = UTF_8.decode(st, DecoderTrap::Replace).unwrap();
|
||||
let status_text = String::from_utf8_lossy(st).into_owned();
|
||||
RawStatus(s, Cow::from(status_text))
|
||||
});
|
||||
self.response.body = response.body.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue