If I copy the example from README.md into a main.rs file and run it, the resulting files does not build. I get the following output:
[6:38:35 PM] ~/Documents/Code/jig-20-interface-http> cargo build
Compiling jig-20-interface-http v0.1.0 (file:///C:/Users/smcro/Documents/Code/jig-20-interface-http)
error[E0277]: the trait bound `for<'r, 'r, 'r> staticfile::Static: std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied
--> src\main.rs:198:7
|
198 | mount.mount("/", Static::new(Path::new("target/doc/")));
| ^^^^^ the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not implemented for `staticfile::Static`
|
= note: required because of the requirements on the impl of `iron::Handler` for `staticfile::Static`
error[E0277]: the trait bound `for<'r, 'r, 'r> staticfile::Static: std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied
--> src\main.rs:198:7
|
198 | mount.mount("/", Static::new(Path::new("target/doc/")));
| ^^^^^ the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not implemented for `staticfile::Static`
|
= note: required because of the requirements on the impl of `iron::Handler` for `staticfile::Static`
error[E0277]: the trait bound `for<'r, 'r, 'r> staticfile::Static: std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied
--> src\main.rs:200:7
|
200 | mount.mount("/doc/", Static::new(Path::new("target/doc/staticfile/")));
| ^^^^^ the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not implemented for `staticfile::Static`
|
= note: required because of the requirements on the impl of `iron::Handler` for `staticfile::Static`
error[E0277]: the trait bound `for<'r, 'r, 'r> staticfile::Static: std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied
--> src\main.rs:200:7
|
200 | mount.mount("/doc/", Static::new(Path::new("target/doc/staticfile/")));
| ^^^^^ the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not implemented for `staticfile::Static`
|
= note: required because of the requirements on the impl of `iron::Handler` for `staticfile::Static`
error[E0277]: the trait bound `for<'r, 'r, 'r> staticfile::Static: std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied
--> src\main.rs:202:7
|
202 | mount.mount("/src/", Static::new(Path::new("target/doc/src/staticfile/lib.rs.html")));
| ^^^^^ the trait `for<'r, 'r, 'r> std::ops::Fn<(&'r mut iron::Request<'r, 'r>,)>` is not implemented for `staticfile::Static`
|
= note: required because of the requirements on the impl of `iron::Handler` for `staticfile::Static`
error[E0277]: the trait bound `for<'r, 'r, 'r> staticfile::Static: std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not satisfied
--> src\main.rs:202:7
|
202 | mount.mount("/src/", Static::new(Path::new("target/doc/src/staticfile/lib.rs.html")));
| ^^^^^ the trait `for<'r, 'r, 'r> std::ops::FnOnce<(&'r mut iron::Request<'r, 'r>,)>` is not implemented for `staticfile::Static`
|
= note: required because of the requirements on the impl of `iron::Handler` for `staticfile::Static`
error: aborting due to 6 previous errors
error: Could not compile `jig-20-interface-http`.
To learn more, run the command again with --verbose.
[6:40:40 PM] ~/Documents/Code/jig-20-interface-http>
let mut mount = Mount::new();
// Serve the shared JS/CSS at /
mount.mount("/", Static::new(Path::new("target/doc/")));
// Serve the static file docs at /doc/
mount.mount("/doc/", Static::new(Path::new("target/doc/staticfile/")));
// Serve the source code at /src/
mount.mount("/src/", Static::new(Path::new("target/doc/src/staticfile/lib.rs.html")));
Iron::new(mount).http("127.0.0.1:3000").unwrap();
[dependencies]
iron = "*"
router = "*"
mount = "*"
staticfile = "*"
This was built using the latest Rust 1.15.