diff --git a/src/header/common/cookie.rs b/src/header/common/cookie.rs index 46b53d82..09c8b146 100644 --- a/src/header/common/cookie.rs +++ b/src/header/common/cookie.rs @@ -16,6 +16,10 @@ use cookie::CookieJar; #[deriving(Clone, PartialEq, Show)] pub struct Cookies(pub Vec); +//TODO: remove when fixed in libstd +unsafe impl Send for Cookies {} +unsafe impl Sync for Cookies {} + deref!(Cookies -> Vec); impl Header for Cookies { diff --git a/src/header/common/set_cookie.rs b/src/header/common/set_cookie.rs index faa50f51..d861624e 100644 --- a/src/header/common/set_cookie.rs +++ b/src/header/common/set_cookie.rs @@ -13,6 +13,10 @@ use cookie::CookieJar; #[deriving(Clone, PartialEq, Show)] pub struct SetCookie(pub Vec); +//TODO: remove when fixed in libstd +unsafe impl Send for SetCookie {} +unsafe impl Sync for SetCookie {} + deref!(SetCookie -> Vec); impl Header for SetCookie { diff --git a/src/header/mod.rs b/src/header/mod.rs index 1c5c2216..93d384fd 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -5,7 +5,7 @@ //! must implement the `Header` trait from this module. Several common headers //! are already provided, such as `Host`, `ContentType`, `UserAgent`, and others. use std::any::Any; -use std::ascii::{AsciiExt, AsciiCast}; +use std::ascii::AsciiExt; use std::borrow::Cow::{Borrowed, Owned}; use std::fmt::{mod, Show}; use std::intrinsics::TypeId; @@ -127,7 +127,7 @@ impl Headers { loop { match try!(http::read_header(rdr)) { Some((name, value)) => { - debug!("raw header: {}={}", name, value[].to_ascii()); + debug!("raw header: {}={}", name, value[]); let name = CaseInsensitive(Owned(name)); let mut item = match headers.data.entry(name) { Entry::Vacant(entry) => entry.set(MuCell::new(Item::raw(vec![]))), @@ -488,7 +488,7 @@ impl hash::Hash for CaseInsensitive { #[inline] fn hash(&self, hasher: &mut H) { for b in self.as_slice().bytes() { - hasher.write(&[b.to_ascii().to_lowercase().as_byte()]) + hasher.write(&[b.to_ascii_lowercase()]) } } } diff --git a/src/http.rs b/src/http.rs index aa869069..bc36e8c1 100644 --- a/src/http.rs +++ b/src/http.rs @@ -376,8 +376,6 @@ pub fn read_method(stream: &mut R) -> HttpResult { return Err(HttpMethodError); } - debug!("method buf = {}", buf[].to_ascii()); - let maybe_method = match buf[0..7] { b"GET " => Some(method::Method::Get), b"PUT " => Some(method::Method::Put), @@ -548,8 +546,6 @@ pub fn read_header(stream: &mut R) -> HttpResult Ok(Some((name, value))), _ => Err(HttpHeaderError) diff --git a/src/lib.rs b/src/lib.rs index 5b4c0e9a..27eec2ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -154,7 +154,7 @@ use self::HttpError::{HttpMethodError, HttpUriError, HttpVersionError, macro_rules! todo( ($($arg:tt)*) => (if cfg!(not(ndebug)) { - format_args!(|args| log!(5, "TODO: {}", args), $($arg)*) + log!(5, "TODO: {}", format_args!($($arg)*)) }) ); @@ -170,7 +170,7 @@ impl fmt::Show for Trace { macro_rules! trace( ($($arg:tt)*) => (if cfg!(not(ndebug)) { - format_args!(|args| log!(5, "{}\n{}", args, ::Trace), $($arg)*) + log!(5, "{}\n{}", format_args!($($arg)*), ::Trace) }) );