We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f7597a commit fd7632bCopy full SHA for fd7632b
basic-router/Cargo.toml
@@ -2,5 +2,6 @@
2
name = "basic-router"
3
version = "0.1.0"
4
authors = ["You <[email protected]>"]
5
+edition = "2018"
6
7
[dependencies]
basic-router/src/lib.rs
@@ -15,7 +15,7 @@ struct Response {
15
body: Vec<u8>
16
}
17
18
-type BoxedCallback = Box<Fn(&Request) -> Response>;
+type BoxedCallback = Box<dyn Fn(&Request) -> Response>;
19
20
struct BasicRouter {
21
routes: HashMap<String, BoxedCallback>
@@ -35,6 +35,7 @@ impl BasicRouter {
35
36
37
38
+
39
impl BasicRouter {
40
fn handle_request(&self, request: &Request) -> Response {
41
match self.routes.get(&request.url) {
0 commit comments