refactor(hyper): Remove the box_syntax feature gate.
This commit is contained in:
committed by
Sean McArthur
parent
a62323cafe
commit
dbee6af8df
@@ -57,7 +57,7 @@ impl Request<Fresh> {
|
||||
|
||||
let stream = try!(connector.connect(&*host, port, &*url.scheme));
|
||||
// FIXME: Use Type ascription
|
||||
let stream: Box<NetworkStream + Send> = box stream;
|
||||
let stream: Box<NetworkStream + Send> = Box::new(stream);
|
||||
let stream = ThroughWriter(BufWriter::new(stream));
|
||||
|
||||
let mut headers = Headers::new();
|
||||
|
||||
@@ -130,13 +130,13 @@ mod tests {
|
||||
status: status::StatusCode::Ok,
|
||||
headers: Headers::new(),
|
||||
version: version::HttpVersion::Http11,
|
||||
body: EofReader(BufReader::new(box MockStream::new())),
|
||||
body: EofReader(BufReader::new(Box::new(MockStream::new()))),
|
||||
status_raw: RawStatus(200, Borrowed("OK")),
|
||||
_marker: PhantomData,
|
||||
};
|
||||
|
||||
let b = res.into_inner().downcast::<MockStream>().ok().unwrap();
|
||||
assert_eq!(b, box MockStream::new());
|
||||
assert_eq!(b, Box::new(MockStream::new()));
|
||||
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ mod tests {
|
||||
\r\n"
|
||||
);
|
||||
|
||||
let res = Response::new(box stream).unwrap();
|
||||
let res = Response::new(Box::new(stream)).unwrap();
|
||||
|
||||
// The status line is correct?
|
||||
assert_eq!(res.status, status::StatusCode::Ok);
|
||||
@@ -187,7 +187,7 @@ mod tests {
|
||||
\r\n"
|
||||
);
|
||||
|
||||
let res = Response::new(box stream).unwrap();
|
||||
let res = Response::new(Box::new(stream)).unwrap();
|
||||
|
||||
assert!(read_to_string(res).is_err());
|
||||
}
|
||||
@@ -206,7 +206,7 @@ mod tests {
|
||||
\r\n"
|
||||
);
|
||||
|
||||
let res = Response::new(box stream).unwrap();
|
||||
let res = Response::new(Box::new(stream)).unwrap();
|
||||
|
||||
assert!(read_to_string(res).is_err());
|
||||
}
|
||||
@@ -225,7 +225,7 @@ mod tests {
|
||||
\r\n"
|
||||
);
|
||||
|
||||
let res = Response::new(box stream).unwrap();
|
||||
let res = Response::new(Box::new(stream)).unwrap();
|
||||
|
||||
assert_eq!(read_to_string(res), Ok("1".to_string()));
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ impl Item {
|
||||
fn parse<H: Header + HeaderFormat>(raw: &Vec<Vec<u8>>) -> Option<Box<HeaderFormat + Send + Sync>> {
|
||||
Header::parse_header(&raw[..]).map(|h: H| {
|
||||
// FIXME: Use Type ascription
|
||||
let h: Box<HeaderFormat + Send + Sync> = box h;
|
||||
let h: Box<HeaderFormat + Send + Sync> = Box::new(h);
|
||||
h
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![doc(html_root_url = "https://hyperium.github.io/hyper/hyper/index.html")]
|
||||
#![feature(core, io,
|
||||
box_syntax, unsafe_destructor, into_cow, convert)]
|
||||
#![feature(core, io, unsafe_destructor, into_cow, convert)]
|
||||
#![deny(missing_docs)]
|
||||
#![cfg_attr(test, deny(warnings))]
|
||||
#![cfg_attr(test, feature(alloc, test))]
|
||||
|
||||
@@ -355,20 +355,20 @@ mod tests {
|
||||
#[test]
|
||||
fn test_downcast_box_stream() {
|
||||
// FIXME: Use Type ascription
|
||||
let stream: Box<NetworkStream + Send> = box MockStream::new();
|
||||
let stream: Box<NetworkStream + Send> = Box::new(MockStream::new());
|
||||
|
||||
let mock = stream.downcast::<MockStream>().ok().unwrap();
|
||||
assert_eq!(mock, box MockStream::new());
|
||||
assert_eq!(mock, Box::new(MockStream::new()));
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_downcast_unchecked_box_stream() {
|
||||
// FIXME: Use Type ascription
|
||||
let stream: Box<NetworkStream + Send> = box MockStream::new();
|
||||
let stream: Box<NetworkStream + Send> = Box::new(MockStream::new());
|
||||
|
||||
let mock = unsafe { stream.downcast_unchecked::<MockStream>() };
|
||||
assert_eq!(mock, box MockStream::new());
|
||||
assert_eq!(mock, Box::new(MockStream::new()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user