diff --git a/basic-router/Cargo.toml b/basic-router/Cargo.toml index d5b345f..30a388c 100644 --- a/basic-router/Cargo.toml +++ b/basic-router/Cargo.toml @@ -2,5 +2,6 @@ name = "basic-router" version = "0.1.0" authors = ["You "] +edition = "2018" [dependencies] diff --git a/basic-router/src/lib.rs b/basic-router/src/lib.rs index 0d78483..a6ea9a9 100644 --- a/basic-router/src/lib.rs +++ b/basic-router/src/lib.rs @@ -15,7 +15,7 @@ struct Response { body: Vec } -type BoxedCallback = Box Response>; +type BoxedCallback = Box Response>; struct BasicRouter { routes: HashMap @@ -35,6 +35,7 @@ impl BasicRouter { } } + impl BasicRouter { fn handle_request(&self, request: &Request) -> Response { match self.routes.get(&request.url) {