I'm trying to build a web service with Iron using this source as a tutorial, but I'm getting errors during compilation of hyper:
Compiling hyper v0.9.17
/root/.cargo/registry/src/github.com-88ac128001ac3a9a/hyper-0.9.17/src/header/common/accept_language.rs:62:23: 62:30 error: macro undefined: 'langtag!'
/root/.cargo/registry/src/github.com-88ac128001ac3a9a/hyper-0.9.17/src/header/common/accept_language.rs:62 qitem(langtag!(en;;;US)),
^~~~~~~
/root/.cargo/registry/src/github.com-88ac128001ac3a9a/hyper-0.9.17/src/header/common/accept_language.rs:63:34: 63:41 error: macro undefined: 'langtag!'
/root/.cargo/registry/src/github.com-88ac128001ac3a9a/hyper-0.9.17/src/header/common/accept_language.rs:63 QualityItem::new(langtag!(en), Quality(500)),
^~~~~~~
/root/.cargo/registry/src/github.com-88ac128001ac3a9a/hyper-0.9.17/src/header/common/accept_language.rs:64:23: 64:30 error: macro undefined: 'langtag!'
/root/.cargo/registry/src/github.com-88ac128001ac3a9a/hyper-0.9.17/src/header/common/accept_language.rs:64 qitem(langtag!(fr)),
^~~~~~~
Versions I'm using:
- cargo 0.8.0 (built 2016-03-22)
- rustc 1.7.0
Cargo.toml
[package]
name = "hello"
version = "0.1.0"
authors = ["root"]
[dependencies]
language-tags = "0.2.2"
iron = "0.4.0"
main.rs:
extern crate iron;
use iron::prelude::*;
use iron::status;
use iron::mime::Mime;
fn main() {
Iron::new(|_: &mut Request| {
let content_type = "application/json".parse::<Mime>().unwrap();
Ok(Response::with((content_type, status::Ok, "{ respone: \"Hello world!\" }")))
}).http("localhost:3009").unwrap();
}
I only added the language-tags in the Cargo.toml because I thought it would be solve my problem. Additional changes were not made.