Unable to build Hyper-invalid character `-` in bucket name

I am trying to start a hypereinstance specified in a Github read file.

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 like this:

[package]

name = <crate_name>
version = <version>
authors = <authors>

[dependencies]
hyper = "0.3"

      

However, when I try to create it using Cargo, I get the 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 went through these different boxes trying to figure out if I could just change "rustc-serialize" to "rustc_serialize" because I think the box names no longer have a hyphen. However, I couldn't find anything like it. I would really like to solve this problem because I have a feeling that I will run into this error a few more times while Rust is still polished.

Edit: The versions are as follows: Rust: 1.0.0-beta.2 Hyper: 0.34 Cargo: 0.0.1 - Until Night (built 2015-03-09)

+3


source to share


1 answer


It seems that your version of Hyper requires a newer version of Rust that automatically converts hyphens to underscores in drawer names.



See RFC 940 and Issue # 23533 .

+4


source







All Articles