我正在尝试使用rust-http库,我想将它作为一个小项目的基础.
我不知道如何使用我无法安装的东西rustpkg install <remote_url>.事实上,我今天发现rustpkg现在已经弃用了.
如果我git clone是库并运行适当的make命令来构建它,我该如何在其他地方使用它?即我如何实际使用extern crate http?
我尝试用命令编译我的项目cargo build.
build.rs
extern crate csv;
use std::path::Path;
use std::fs::OpenOptions;
use std::io::BufWriter;
use std::io::Write;
#[allow(non_snake_case)]
fn processCSV(filename: &str, sourcePath: &str, enumName: &str) {
    println!("Generate rust source code from schema {}",filename);
    let mut ret: Vec<String> = Vec::new();
    let mut rdr = csv::Reader::from_file(filename).unwrap().flexible(true);
    for record in rdr.records().map(|r| r.unwrap()) {
    }
    let path = Path::new(sourcePath);
    let file = match OpenOptions::new().write(true).create(true).open(&path) {
        Ok(file) => file,
        Err(..) => panic!("Cannot create file {}",path.display()),
    };
    let mut writer = BufWriter::new(file);
    writer.write_all(b"test\n");
}
fn main() { …