Skip to content

Commit

Permalink
fix: unneeded variable on main handler
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai committed Oct 9, 2020
1 parent 295261d commit ddade36
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/handler/main_handler.rs
Expand Up @@ -7,10 +7,11 @@ use tiny_http::{Request, Response, ResponseBox};
pub fn main_handler(req: Request, fexplorer: &FileExplorer) -> (Request, ResponseBox) {
match req.method().to_string().to_lowercase().as_str() {
"get" => file_explorer(req, fexplorer),
_ => {
let response = Response::from_string("Method Not Allowed").with_status_code(405);

(req, response.boxed())
}
_ => (
req,
Response::from_string("Method Not Allowed")
.with_status_code(405)
.boxed(),
),
}
}

0 comments on commit ddade36

Please sign in to comment.