Skip to content

Commit 4e735ff

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 4e735ff

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ keywords = ["iron", "web", "http", "routing", "router"]
1313
route-recognizer = "0.1"
1414
iron = { git = "https://github.com/iron/iron", branch = "master" }
1515
url = "1.1"
16+
17+
[patch.crates-io.route-recognizer]
18+
git = "https://github.com/miller-time/route-recognizer.rs"
19+
rev = "d7bc06d2dc58a2c59d8f2cfbee2ab23b8188700d"

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)