rust - Unable to build Hyper - invalid character `-` in crate name -


i trying run hyper example listed on github readme.

extern crate hyper;  use std::io::write;  use hyper::server; use hyper::server::request; use hyper::server::response; use hyper::net::fresh;  fn hello(_: request, res: response<fresh>) {     let mut res = res.start().unwrap();     res.write_all(b"hello world!").unwrap();     res.end().unwrap(); }  fn main() {     server::http(hello).listen("127.0.0.1:3000").unwrap(); } 

and cargo.toml looks this:

[package]  name = <crate_name> version = <version> authors = <authors>  [dependencies] hyper = "0.3" 

however, when attempt build using cargo run following error:

error: invalid character `-` in crate name: `build-script-build` error: invalid character `-` in crate name: `pkg-config` error: invalid character `-` in crate name: `rustc-serialize` 

i looked through these different crates trying see if maybe change "rustc-serialize" "rustc_serialize" because think crate names can no longer have hyphens. however, couldn't find of sort. able solve problem because have feeling going run error few more times while rust still being polished.

edit: versions follows: rust: 1.0.0-beta.2 hyper: 0.3.14 cargo: 0.0.1-pre-nightly (built 2015-03-09)

your version of hyper seems require newer version of rust, automatically converts hyphens underscores in crate names.

see rfc 940 , issue #23533.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -