Skip to content

Commit 5b49076

Browse files
committed
Merge pull request #181 from hyperium/rustup
rustup
2 parents ae88092 + debebe8 commit 5b49076

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#![feature(macro_rules, phase, default_type_params, if_let, slicing_syntax,
2-
tuple_indexing, globs)]
1+
#![feature(macro_rules, phase, default_type_params, slicing_syntax, globs)]
32
#![deny(missing_docs)]
43
#![deny(warnings)]
54
#![experimental]

src/server/request.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use http::HttpReader;
1515
use http::HttpReader::{SizedReader, ChunkedReader, EmptyReader};
1616
use uri::RequestUri;
1717

18-
pub type InternalReader<'a> = &'a mut (Reader + 'a);
19-
2018
/// A request bundles several parts of an incoming `NetworkStream`, given to a `Handler`.
2119
pub struct Request<'a> {
2220
/// The IP address of the remote connection.
@@ -29,15 +27,15 @@ pub struct Request<'a> {
2927
pub uri: RequestUri,
3028
/// The version of HTTP for this request.
3129
pub version: HttpVersion,
32-
body: HttpReader<InternalReader<'a>>
30+
body: HttpReader<&'a mut (Reader + 'a)>
3331
}
3432

3533

3634
impl<'a> Request<'a> {
3735

3836
/// Create a new Request, reading the StartLine and Headers so they are
3937
/// immediately useful.
40-
pub fn new(mut stream: InternalReader<'a>, addr: SocketAddr) -> HttpResult<Request<'a>> {
38+
pub fn new(mut stream: &'a mut (Reader + 'a), addr: SocketAddr) -> HttpResult<Request<'a>> {
4139
let (method, uri, version) = try!(read_request_line(&mut stream));
4240
debug!("Request Line: {} {} {}", method, uri, version);
4341
let headers = try!(Headers::from_raw(&mut stream));

src/server/response.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ use status;
1414
use net::{Fresh, Streaming};
1515
use version;
1616

17-
pub type InternalWriter<'a> = &'a mut (Writer + 'a);
18-
1917
/// The outgoing half for a Tcp connection, created by a `Server` and given to a `Handler`.
2018
pub struct Response<'a, W = Fresh> {
2119
/// The HTTP version of this response.
2220
pub version: version::HttpVersion,
2321
// Stream the Response is writing to, not accessible through UnwrittenResponse
24-
body: HttpWriter<InternalWriter<'a>>,
22+
body: HttpWriter<&'a mut (Writer + 'a)>,
2523
// The status code for the request.
2624
status: status::StatusCode,
2725
// The outgoing headers on this response.
@@ -38,7 +36,7 @@ impl<'a, W> Response<'a, W> {
3836

3937
/// Construct a Response from its constituent parts.
4038
pub fn construct(version: version::HttpVersion,
41-
body: HttpWriter<InternalWriter<'a>>,
39+
body: HttpWriter<&'a mut (Writer + 'a)>,
4240
status: status::StatusCode,
4341
headers: header::Headers) -> Response<'a, Fresh> {
4442
Response {
@@ -50,15 +48,15 @@ impl<'a, W> Response<'a, W> {
5048
}
5149

5250
/// Deconstruct this Response into its constituent parts.
53-
pub fn deconstruct(self) -> (version::HttpVersion, HttpWriter<InternalWriter<'a>>,
51+
pub fn deconstruct(self) -> (version::HttpVersion, HttpWriter<&'a mut (Writer + 'a)>,
5452
status::StatusCode, header::Headers) {
5553
(self.version, self.body, self.status, self.headers)
5654
}
5755
}
5856

5957
impl<'a> Response<'a, Fresh> {
6058
/// Creates a new Response that can be used to write to a network stream.
61-
pub fn new(stream: InternalWriter<'a>) -> Response<'a, Fresh> {
59+
pub fn new(stream: &'a mut (Writer + 'a)) -> Response<'a, Fresh> {
6260
Response {
6361
status: status::StatusCode::Ok,
6462
version: version::HttpVersion::Http11,

0 commit comments

Comments
 (0)