From fd7632bb9b6288410ffc22cc420f827a4234450e Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 6 Jun 2021 16:07:51 -0700 Subject: [PATCH] basic-router: Update. --- basic-router/Cargo.toml | 1 + basic-router/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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) {