Skip to content

Commit

Permalink
refactor(hyper): Remove the box_syntax feature gate.
Browse files Browse the repository at this point in the history
  • Loading branch information
reem authored and seanmonstar committed Mar 27, 2015
1 parent a62323c commit dbee6af
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/client/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions src/client/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

}

Expand All @@ -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);
Expand Down Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand All @@ -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()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/header/internals/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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))]
Expand Down
8 changes: 4 additions & 4 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

}

Expand Down

0 comments on commit dbee6af

Please sign in to comment.