目录结构
workspace-test/
Cargo.toml
db/
src/
bin/
init.rs
Cargo.tml
workspace
workspace-test/Cargo.toml
[workspace]
members = ["db"]
default-member = "db"
子项目
workspace-test/db/Cargo.toml
[package]
name = "db"
version = "0.1.0"
edition = "2018"
[dependencies]
# 可选的可执行文件配置
# [[bin]]
# name = "init"
# path = "src/bin/init.rs"
操作
# 运行 init
cargo run --bin init
# -p 指定项目
cargo run -p db --bin init
1
共 0 条评论, 1 页
评论区
写评论还没有评论