cargo
无法确定要运行哪一个二进制文件, 可以使用--bin
指定一个二进制文件, 或者在cargo.toml
中加一个default-run
的key.
cargo run --bin project_name_or_binary_name
or
[package]
name = "hello"
version = "0.1.0"
authors = ["Floyda <floyda@163.com>"]
edition = "2018"
default-run="hello" # 默认运行哪个二进制文件
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
[[bin]]
name="foo"
path="src/foo.rs"