Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
sansyrox committed Jun 22, 2021
1 parent 9f283df commit a1442d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
3 changes: 0 additions & 3 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ pub async fn handle_message(process_object: Py<PyAny>, mut stream: TcpStream) {
let coro = handler.call0().unwrap();
PyFunction::CoRoutine(coro.into())
} else {
// let s: &str = handler.call0().unwrap().extract().unwrap();
// PyFunction::SyncFunction(String::from(s))
PyFunction::SyncFunction(handler.into())
}
});
Expand Down Expand Up @@ -49,7 +47,6 @@ pub async fn handle_message(process_object: Py<PyAny>, mut stream: TcpStream) {
.unwrap(),
};

// let output = op.await.unwrap();
let status_line = "HTTP/1.1 200 OK";

let len = contents.len();
Expand Down
13 changes: 2 additions & 11 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,8 @@ impl Server {
};
}

pub fn add_route(
&self,
route_type: &str,
route: String,
handler: Py<PyAny>,
) {
// Python::with_gil(|py| {
// let py_dict: &PyDict = py_obj.as_ref(py);
// println!("{}", py_dict.get_item("is_coroutine").unwrap());
// });
println!("{} {} ", route_type, route);
pub fn add_route(&self, route_type: &str, route: String, handler: Py<PyAny>) {
println!("Route added for {} {} ", route_type, route);
let route = Route::new(RouteType::Route((route, route_type.to_string())));
self.router.add_route(route_type, route, handler);
}
Expand Down

0 comments on commit a1442d0

Please sign in to comment.