Skip to content

Commit

Permalink
Convert StatusCode from enum to struct(u16)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc committed Dec 13, 2014
1 parent 2d6c881 commit 9c2b06b
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 1,463 deletions.
2 changes: 1 addition & 1 deletion src/client/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod tests {
#[test]
fn test_unwrap() {
let res = Response {
status: status::StatusCode::Ok,
status: status::Ok,
headers: Headers::new(),
version: version::HttpVersion::Http11,
body: EofReader(BufferedReader::new(box MockStream::new() as Box<NetworkStream + Send>)),
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub use std::io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr, Port};
pub use mimewrapper::mime;
pub use url::Url;
pub use method::Method::{Get, Head, Post, Delete};
pub use status::StatusCode::{Ok, BadRequest, NotFound};
pub use status::{Ok, BadRequest, NotFound};
pub use server::Server;

use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion src/server/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'a> Response<'a, Fresh> {
/// Creates a new Response that can be used to write to a network stream.
pub fn new(stream: &'a mut (Writer + 'a)) -> Response<'a, Fresh> {
Response {
status: status::StatusCode::Ok,
status: status::Ok,
version: version::HttpVersion::Http11,
headers: header::Headers::new(),
body: ThroughWriter(stream)
Expand Down
Loading

0 comments on commit 9c2b06b

Please sign in to comment.