Skip to content

Commit b962c55

Browse files
robinstuntitaker
authored andcommitted
Update for iron 0.6 (iron#141)
* Adapt error handling to changes in iron * Fix compilation warning about unnecessary `mut` * Bump crate version for release
1 parent 32b4ef5 commit b962c55

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
name = "router"
44
authors = ["Jonathan Reem <jonathan.reem@gmail.com>"]
55
license = "MIT"
6-
version = "0.5.1"
6+
version = "0.6.0"
77
description = "A router for the Iron framework."
88
repository = "https://github.com/iron/router"
99
documentation = "http://ironframework.io/doc/router/index.html"
1010
keywords = ["iron", "web", "http", "routing", "router"]
1111

1212
[dependencies]
1313
route-recognizer = "0.1"
14-
iron = "0.5"
14+
iron = "0.6"
1515
url = "1.1"

examples/custom_404.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl AfterMiddleware for Custom404 {
1616
fn catch(&self, _: &mut Request, err: IronError) -> IronResult<Response> {
1717
println!("Hitting custom 404 middleware");
1818

19-
if let Some(_) = err.error.downcast::<NoRoute>() {
19+
if err.error.is::<NoRoute>() {
2020
Ok(Response::with((status::NotFound, "Custom 404 response")))
2121
} else {
2222
Err(err)

src/router.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl Router {
8181
}
8282

8383
fn route_id(&mut self, id: &str, glob: &str) {
84-
let mut mut_inner = self.mut_inner();
85-
let ref mut route_ids = mut_inner.route_ids;
84+
let inner = self.mut_inner();
85+
let ref mut route_ids = inner.route_ids;
8686

8787
match route_ids.get(id) {
8888
Some(other_glob) if glob != other_glob => panic!("Duplicate route_id: {}", id),

0 commit comments

Comments
 (0)