{"action":"created","issue":{"url":"https://api.github.com/repos/iron/router/issues/121","repository_url":"https://api.github.com/repos/iron/router","labels_url":"https://api.github.com/repos/iron/router/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/iron/router/issues/121/comments","events_url":"https://api.github.com/repos/iron/router/issues/121/events","html_url":"https://github.com/iron/router/issues/121","id":166970958,"number":121,"title":"Example from README doesn't compile","user":{"login":"AtheMathmo","id":10150986,"avatar_url":"https://avatars.githubusercontent.com/u/10150986?v=3","gravatar_id":"","url":"https://api.github.com/users/AtheMathmo","html_url":"https://github.com/AtheMathmo","followers_url":"https://api.github.com/users/AtheMathmo/followers","following_url":"https://api.github.com/users/AtheMathmo/following{/other_user}","gists_url":"https://api.github.com/users/AtheMathmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AtheMathmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtheMathmo/subscriptions","organizations_url":"https://api.github.com/users/AtheMathmo/orgs","repos_url":"https://api.github.com/users/AtheMathmo/repos","events_url":"https://api.github.com/users/AtheMathmo/events{/privacy}","received_events_url":"https://api.github.com/users/AtheMathmo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-22T05:07:29Z","updated_at":"2016-07-22T13:42:41Z","closed_at":null,"body":"I'm using iron v0.4.0 and router v0.1.1 . When I try to compile the example code from the README I get the following error output:\r\n\r\n```\r\nsrc/main.rs:12:12: 12:15 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}` implements the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]\r\nsrc/main.rs:12     router.get(\"/\", handler);\r\n                          ^~~\r\nsrc/main.rs:12:12: 12:15 help: run `rustc --explain E0281` to see a detailed explanation\r\nsrc/main.rs:12:12: 12:15 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}`\r\nsrc/main.rs:12:12: 12:15 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}` implements the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]\r\nsrc/main.rs:12     router.get(\"/\", handler);\r\n                          ^~~\r\nsrc/main.rs:12:12: 12:15 help: run `rustc --explain E0281` to see a detailed explanation\r\nsrc/main.rs:12:12: 12:15 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}`\r\nsrc/main.rs:13:12: 13:15 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}` implements the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]\r\nsrc/main.rs:13     router.get(\"/:query\", handler);\r\n                          ^~~\r\nsrc/main.rs:13:12: 13:15 help: run `rustc --explain E0281` to see a detailed explanation\r\nsrc/main.rs:13:12: 13:15 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}`\r\nsrc/main.rs:13:12: 13:15 error: type mismatch: the type `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}` implements the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>`, but the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::request::Request<'r, 'r>,)>` is required (expected struct `iron::request::Request`, found struct `iron::Request`) [E0281]\r\nsrc/main.rs:13     router.get(\"/:query\", handler);\r\n                          ^~~\r\nsrc/main.rs:13:12: 13:15 help: run `rustc --explain E0281` to see a detailed explanation\r\nsrc/main.rs:13:12: 13:15 note: required because of the requirements on the impl of `iron::middleware::Handler` for `fn(&mut iron::Request<'_, '_>) -> std::result::Result<iron::Response, iron::IronError> {main::handler}`\r\nsrc/main.rs:15:5: 15:14 error: the trait bound `for<'r, 'r, 'r> router::Router: std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied [E0277]\r\nsrc/main.rs:15     Iron::new(router).http(\"localhost:3000\").unwrap();\r\n                   ^~~~~~~~~\r\nsrc/main.rs:15:5: 15:14 help: run `rustc --explain E0277` to see a detailed explanation\r\nsrc/main.rs:15:5: 15:14 note: required because of the requirements on the impl of `iron::Handler` for `router::Router`\r\nsrc/main.rs:15:5: 15:14 note: required by `iron::Iron::new`\r\nsrc/main.rs:15:5: 15:14 error: the trait bound `for<'r, 'r, 'r> router::Router: std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied [E0277]\r\nsrc/main.rs:15     Iron::new(router).http(\"localhost:3000\").unwrap();\r\n                   ^~~~~~~~~\r\nsrc/main.rs:15:5: 15:14 help: run `rustc --explain E0277` to see a detailed explanation\r\nsrc/main.rs:15:5: 15:14 note: required because of the requirements on the impl of `iron::Handler` for `router::Router`\r\nsrc/main.rs:15:5: 15:14 note: required by `iron::Iron::new`\r\nsrc/main.rs:15:23: 15:27 error: no method named `http` found for type `iron::Iron<router::Router>` in the current scope\r\nsrc/main.rs:15     Iron::new(router).http(\"localhost:3000\").unwrap();\r\n                                     ^~~~\r\nsrc/main.rs:15:23: 15:27 note: the method `http` exists but the following trait bounds were not satisfied: `router::Router : iron::Handler`\r\nerror: aborting due to 7 previous errors\r\n```\r\n\r\nI don't have time tonight to dig into this but will be happy to explore more tomorrow.\r\n\r\nAlso - if this is indeed an error can I suggest that this example be included in the `lib` module documentation to prevent breakage in future."},"comment":{"url":"https://api.github.com/repos/iron/router/issues/comments/234547096","html_url":"https://github.com/iron/router/issues/121#issuecomment-234547096","issue_url":"https://api.github.com/repos/iron/router/issues/121","id":234547096,"user":{"login":"AtheMathmo","id":10150986,"avatar_url":"https://avatars.githubusercontent.com/u/10150986?v=3","gravatar_id":"","url":"https://api.github.com/users/AtheMathmo","html_url":"https://github.com/AtheMathmo","followers_url":"https://api.github.com/users/AtheMathmo/followers","following_url":"https://api.github.com/users/AtheMathmo/following{/other_user}","gists_url":"https://api.github.com/users/AtheMathmo/gists{/gist_id}","starred_url":"https://api.github.com/users/AtheMathmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtheMathmo/subscriptions","organizations_url":"https://api.github.com/users/AtheMathmo/orgs","repos_url":"https://api.github.com/users/AtheMathmo/repos","events_url":"https://api.github.com/users/AtheMathmo/events{/privacy}","received_events_url":"https://api.github.com/users/AtheMathmo/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T13:42:41Z","updated_at":"2016-07-22T13:42:41Z","body":"I managed to get it to compile by using iron v0.3.0. I'm not sure how it's best to deal with this in future - it seems there was a breaking change and Cargo didn't stop me using iron 0.4.0 despite router depending on 0.3.0."}}
{"actor":{"display_login":"AtheMathmo"}}