mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Move to to_owned rather than into_string.
into_string has been removed from Rust.
This commit is contained in:
parent
2d5b0e0855
commit
01ed338746
67 changed files with 473 additions and 383 deletions
|
@ -10,6 +10,7 @@ use url::Url;
|
|||
use hyper::http::RawStatus;
|
||||
use servo_util::resource_files::resources_dir_path;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::io::fs::PathExtensions;
|
||||
|
||||
pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
|
||||
|
@ -24,7 +25,7 @@ pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>
|
|||
content_type: Some(("text".to_string(), "html".to_string())),
|
||||
charset: Some("utf-8".to_string()),
|
||||
headers: None,
|
||||
status: Some(RawStatus(200, "OK".into_string()))
|
||||
status: Some(RawStatus(200, "OK".to_owned()))
|
||||
});
|
||||
chan.send(Done(Ok(())));
|
||||
return
|
||||
|
|
|
@ -15,6 +15,8 @@ use std::io::Reader;
|
|||
use servo_util::task::spawn_named;
|
||||
use url::{Url, UrlParser};
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
|
||||
pub fn factory(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
|
||||
spawn_named("http_loader", proc() load(load_data, start_chan))
|
||||
}
|
||||
|
@ -85,7 +87,7 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
|
|||
// FIXME(seanmonstar): use AcceptEncoding from Hyper once available
|
||||
//if !req.headers.has::<AcceptEncoding>() {
|
||||
// We currently don't support HTTP Compression (FIXME #2587)
|
||||
req.headers_mut().set_raw("Accept-Encoding".into_string(), vec![b"identity".to_vec()]);
|
||||
req.headers_mut().set_raw("Accept-Encoding".to_owned(), vec![b"identity".to_vec()]);
|
||||
//}
|
||||
let writer = match load_data.data {
|
||||
Some(ref data) => {
|
||||
|
|
|
@ -20,6 +20,7 @@ use hyper::method::Method;
|
|||
use hyper::mime::{Mime, Attr};
|
||||
use url::Url;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::comm::{channel, Receiver, Sender};
|
||||
|
||||
pub enum ControlMsg {
|
||||
|
@ -86,7 +87,7 @@ impl Metadata {
|
|||
charset: None,
|
||||
headers: None,
|
||||
// http://fetch.spec.whatwg.org/#concept-response-status-message
|
||||
status: Some(RawStatus(200, "OK".into_string()))
|
||||
status: Some(RawStatus(200, "OK".to_owned()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue