Skip to content

Commit 226a13a

Browse files
committed
fix nightly build
closes iron#148 - use patch for route-recognizer - add `dyn` to trait objects I guess route-recognizer is no longer maintained? My PR: http-rs/route-recognizer#25 Comment from Alex Crichton: http-rs/route-recognizer#26 (comment)
1 parent 1594944 commit 226a13a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[package]
2-
32
name = "router"
43
authors = ["Jonathan Reem <jonathan.reem@gmail.com>"]
54
license = "MIT"
@@ -10,6 +9,6 @@ documentation = "http://ironframework.io/doc/router/index.html"
109
keywords = ["iron", "web", "http", "routing", "router"]
1110

1211
[dependencies]
13-
route-recognizer = "0.1"
12+
route-recognizer = "0.1.13"
1413
iron = { git = "https://github.com/iron/iron", branch = "master" }
1514
url = "1.1"

src/router.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use recognizer::{Match, Params};
1414

1515
pub struct RouterInner {
1616
// The routers, specialized by method.
17-
pub routers: HashMap<method::Method, Recognizer<Box<Handler>>>,
17+
pub routers: HashMap<method::Method, Recognizer<Box<dyn Handler>>>,
1818
// Routes that accept any method.
19-
pub wildcard: Recognizer<Box<Handler>>,
19+
pub wildcard: Recognizer<Box<dyn Handler>>,
2020
// Used in URL generation.
2121
pub route_ids: HashMap<String, String>
2222
}
@@ -136,7 +136,7 @@ impl Router {
136136
}
137137

138138
fn recognize(&self, method: &method::Method, path: &str)
139-
-> Option<Match<&Box<Handler>>> {
139+
-> Option<Match<&Box<dyn Handler>>> {
140140
self.inner.routers.get(method).and_then(|router| router.recognize(path).ok())
141141
.or(self.inner.wildcard.recognize(path).ok())
142142
}

0 commit comments

Comments
 (0)