From 226a13a4cc64aac14bf09c12e0d19874aea6e67a Mon Sep 17 00:00:00 2001 From: Russell Cousineau Date: Fri, 9 Aug 2019 09:23:19 -0700 Subject: [PATCH] fix nightly build closes #148 - use patch for route-recognizer - add `dyn` to trait objects I guess route-recognizer is no longer maintained? My PR: https://github.com/conduit-rust/route-recognizer.rs/pull/25 Comment from Alex Crichton: https://github.com/conduit-rust/route-recognizer.rs/pull/26#issuecomment-519534860 --- Cargo.toml | 3 +-- src/router.rs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 365ace2..1f10aa5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,4 @@ [package] - name = "router" authors = ["Jonathan Reem "] license = "MIT" @@ -10,6 +9,6 @@ documentation = "http://ironframework.io/doc/router/index.html" keywords = ["iron", "web", "http", "routing", "router"] [dependencies] -route-recognizer = "0.1" +route-recognizer = "0.1.13" iron = { git = "https://github.com/iron/iron", branch = "master" } url = "1.1" diff --git a/src/router.rs b/src/router.rs index 7ba94f9..3fb5736 100644 --- a/src/router.rs +++ b/src/router.rs @@ -14,9 +14,9 @@ use recognizer::{Match, Params}; pub struct RouterInner { // The routers, specialized by method. - pub routers: HashMap>>, + pub routers: HashMap>>, // Routes that accept any method. - pub wildcard: Recognizer>, + pub wildcard: Recognizer>, // Used in URL generation. pub route_ids: HashMap } @@ -136,7 +136,7 @@ impl Router { } fn recognize(&self, method: &method::Method, path: &str) - -> Option>> { + -> Option>> { self.inner.routers.get(method).and_then(|router| router.recognize(path).ok()) .or(self.inner.wildcard.recognize(path).ok()) }