other rustup fallout
This commit is contained in:
@@ -42,7 +42,7 @@ impl HeaderFormat for Vary {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Vary;
|
||||
use header::{Header, CaseInsensitive};
|
||||
use header::Header;
|
||||
|
||||
#[test]
|
||||
fn test_vary() {
|
||||
@@ -52,8 +52,8 @@ mod tests {
|
||||
assert_eq!(vary, Some(Vary::Any));
|
||||
|
||||
vary = Header::parse_header([b"etag,cookie,allow".to_vec()].as_slice());
|
||||
assert_eq!(vary, Some(Vary::Headers(vec![from_str::<CaseInsensitive>("eTag").unwrap(),
|
||||
from_str::<CaseInsensitive>("cookIE").unwrap(),
|
||||
from_str::<CaseInsensitive>("AlLOw").unwrap(),])));
|
||||
assert_eq!(vary, Some(Vary::Headers(vec!["eTag".parse().unwrap(),
|
||||
"cookIE".parse().unwrap(),
|
||||
"AlLOw".parse().unwrap(),])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_accept() {
|
||||
let text_plain = Mime(Text, Plain, vec![]);
|
||||
let application_vendor = from_str("application/vnd.github.v3.full+json; q=0.5").unwrap();
|
||||
let application_vendor = "application/vnd.github.v3.full+json; q=0.5".parse().unwrap();
|
||||
|
||||
let accept = Header::parse_header([b"text/plain".to_vec()].as_slice());
|
||||
assert_eq!(accept, Some(Accept(vec![text_plain.clone()])));
|
||||
@@ -574,8 +574,8 @@ mod tests {
|
||||
}
|
||||
// we JUST checked that raw.len() == 1, so raw[0] WILL exist.
|
||||
match from_utf8(unsafe { raw.as_slice().unsafe_get(0).as_slice() }) {
|
||||
Some(s) => FromStr::from_str(s),
|
||||
None => None
|
||||
Ok(s) => FromStr::from_str(s),
|
||||
Err(_) => None
|
||||
}.map(|u| CrazyLength(Some(false), u))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ impl Writer for MockStream {
|
||||
|
||||
impl NetworkStream for MockStream {
|
||||
fn peer_name(&mut self) -> IoResult<SocketAddr> {
|
||||
Ok(from_str("127.0.0.1:1337").unwrap())
|
||||
Ok("127.0.0.1:1337".parse().unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ pub trait Handler: Sync + Send {
|
||||
fn handle(&self, Request, Response<Fresh>);
|
||||
}
|
||||
|
||||
impl Handler for fn(Request, Response<Fresh>) {
|
||||
impl<F> Handler for F where F: Fn(Request, Response<Fresh>), F: Sync + Send {
|
||||
fn handle(&self, req: Request, res: Response<Fresh>) {
|
||||
(*self)(req, res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user