aboutsummaryrefslogtreecommitdiffstats
path: root/components/net
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-01-04 11:53:35 +0100
committerMs2ger <ms2ger@gmail.com>2015-01-04 15:26:40 +0100
commitb16f9cea092c7591117684491565bcc528fca391 (patch)
treed7f734234564068cab598927947930cd6b009313 /components/net
parent3be587606f7172354632bdbc339e0bf1d97ae2a2 (diff)
downloadservo-b16f9cea092c7591117684491565bcc528fca391.tar.gz
servo-b16f9cea092c7591117684491565bcc528fca391.zip
Qualify hyper enums.
Diffstat (limited to 'components/net')
-rw-r--r--components/net/fetch/request.rs10
-rw-r--r--components/net/fetch/response.rs3
-rw-r--r--components/net/http_loader.rs8
-rw-r--r--components/net/resource_task.rs8
4 files changed, 15 insertions, 14 deletions
diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs
index 4e4139f1f7f..150e5d81b0f 100644
--- a/components/net/fetch/request.rs
+++ b/components/net/fetch/request.rs
@@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use url::Url;
-use hyper::method::{Get, Method};
-use hyper::mime::{Mime, Text, Html, Charset, Utf8};
+use hyper::method::Method;
+use hyper::mime::{mod, Mime};
use hyper::header::Headers;
use hyper::header::common::ContentType;
use fetch::cors_cache::CORSCache;
@@ -87,7 +87,7 @@ pub struct Request {
impl Request {
pub fn new(url: Url, context: Context) -> Request {
Request {
- method: Get,
+ method: Method::Get,
url: url,
headers: Headers::new(),
unsafe_request: false,
@@ -118,7 +118,9 @@ impl Request {
"about" => match self.url.non_relative_scheme_data() {
Some(s) if s.as_slice() == "blank" => {
let mut response = Response::new();
- response.headers.set(ContentType(Mime(Text, Html, vec![(Charset, Utf8)])));
+ response.headers.set(ContentType(Mime(
+ mime::TopLevel::Text, mime::SubLevel::Html,
+ vec![(mime::Attr::Charset, mime::Value::Utf8)])));
response
},
_ => Response::network_error()
diff --git a/components/net/fetch/response.rs b/components/net/fetch/response.rs
index e194aa9375d..f2ee213560d 100644
--- a/components/net/fetch/response.rs
+++ b/components/net/fetch/response.rs
@@ -4,7 +4,6 @@
use url::Url;
use hyper::status::StatusCode;
-use hyper::status::Ok as StatusOk;
use hyper::header::Headers;
use std::ascii::AsciiExt;
use std::comm::Receiver;
@@ -70,7 +69,7 @@ impl Response {
response_type: ResponseType::Default,
termination_reason: None,
url: None,
- status: Some(StatusOk),
+ status: Some(StatusCode::Ok),
headers: Headers::new(),
body: ResponseBody::Empty,
internal_response: None
diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs
index 2c523209203..ccfca4deb26 100644
--- a/components/net/http_loader.rs
+++ b/components/net/http_loader.rs
@@ -9,8 +9,8 @@ use log;
use std::collections::HashSet;
use hyper::client::Request;
use hyper::header::common::{ContentLength, ContentType, Host, Location};
-use hyper::method::{Get, Head};
-use hyper::status::Redirection;
+use hyper::method::Method;
+use hyper::status::StatusClass;
use std::io::Reader;
use servo_util::task::spawn_named;
use url::{Url, UrlParser};
@@ -108,7 +108,7 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
},
None => {
match load_data.method {
- Get | Head => (),
+ Method::Get | Method::Head => (),
_ => req.headers_mut().set(ContentLength(0))
}
match req.start() {
@@ -136,7 +136,7 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
}
}
- if response.status.class() == Redirection {
+ if response.status.class() == StatusClass::Redirection {
match response.headers.get::<Location>() {
Some(&Location(ref new_url)) => {
// CORS (http://fetch.spec.whatwg.org/#http-fetch, status section, point 9, 10)
diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs
index 23cb90f38be..d7bd8f2e40f 100644
--- a/components/net/resource_task.rs
+++ b/components/net/resource_task.rs
@@ -16,8 +16,8 @@ use servo_util::task::spawn_named;
use hyper::header::common::UserAgent;
use hyper::header::Headers;
use hyper::http::RawStatus;
-use hyper::method::{Method, Get};
-use hyper::mime::{Mime, Charset};
+use hyper::method::Method;
+use hyper::mime::{Mime, Attr};
use url::Url;
use std::comm::{channel, Receiver, Sender};
@@ -43,7 +43,7 @@ impl LoadData {
pub fn new(url: Url, consumer: Sender<LoadResponse>) -> LoadData {
LoadData {
url: url,
- method: Get,
+ method: Method::Get,
headers: Headers::new(),
data: None,
cors: None,
@@ -97,7 +97,7 @@ impl Metadata {
Some(&Mime(ref type_, ref subtype, ref parameters)) => {
self.content_type = Some((type_.to_string(), subtype.to_string()));
for &(ref k, ref v) in parameters.iter() {
- if &Charset == k {
+ if &Attr::Charset == k {
self.charset = Some(v.to_string());
}
}