Rust 我如何消除这个错误;“结构字段速记不稳定”;?
我正在试用一个使用Iron框架的Hello World应用程序。这是我的主要产品。rs:Rust 我如何消除这个错误;“结构字段速记不稳定”;?,rust,Rust,我正在试用一个使用Iron框架的Hello World应用程序。这是我的主要产品。rs: extern crate iron; extern crate router; use iron::prelude::*; use iron::status; use router::Router; fn main() { let mut router = Router::new(); router.get("/", hello_world); router.post("/da
extern crate iron;
extern crate router;
use iron::prelude::*;
use iron::status;
use router::Router;
fn main() {
let mut router = Router::new();
router.get("/", hello_world);
router.post("/data", randomfriend);
fn hello_world(_: &mut Request) -> IronResult<Response> {
Ok(Response::with((status::Ok, "Hello World!")))
}
fn data(_: &mut Request) -> IronResult<Response> {
Ok(Response::with((status::Ok, "Got some data")))
}
Iron::new(router).http("localhost:3000").unwrap();
println!("On 3000");
}
当我运行货物运行时,我得到以下错误:
错误:结构字段速记不稳定(见问题#37340)
看来这个问题已经解决了,但我怎么才能摆脱它呢?我有以下版本:
rustc 1.16.0(30cf806ef 2017-03-10)
(as),因此您必须升级安装
如果您使用Rustop,请参阅。(as),因此您必须升级您的Rust安装
如果使用Rustup,请参阅。您可能应该更新到最新的稳定编译器。此外,该错误在哪一行触发?您可能应该更新到最新的稳定编译器。还有,这个错误是在哪一行触发的?你介意分享一下如何在Mac上更新它吗?我使用Rustop脚本在Mac上安装了Rust!你介意分享一下如何在Mac上更新它吗?我使用Rustop脚本在Mac上安装了Rust!
[package]
name = "webserver-iron"
version = "0.1.0"
[[bin]]
name = "webapp_demo_server"
[dependencies]
iron = "*"
router = "*"