summaryrefslogtreecommitdiff
path: root/src/http/response.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/response.rs')
-rw-r--r--src/http/response.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http/response.rs b/src/http/response.rs
index 850f41e..85430a4 100644
--- a/src/http/response.rs
+++ b/src/http/response.rs
@@ -1,8 +1,8 @@
-use super::{code::Code, header::{HeaderMap, Header}};
+use super::{header::{HeaderMap, Header}};
#[derive(Debug, Clone)]
pub struct Response {
- pub status: Code,
+ pub status: u16,
pub headers: HeaderMap,
pub body: Option<String>
}
@@ -20,7 +20,7 @@ impl Response {
headers.put(Header::new("Server", "bashttp"));
return Self {
- status: Code::Success,
+ status: 200,
headers,
body: None
}
@@ -29,7 +29,7 @@ impl Response {
pub fn deserialize(&self) -> String {
let mut string = String::new();
- string += &format!("HTTP/1.1 {}\n", self.status.clone() as u16);
+ string += &format!("HTTP/1.1 {}\n", self.status);
string += &self.headers.deserialize();
if let Some(body) = &self.body {