更新 README.md

This commit is contained in:
shikong 2024-05-25 17:52:48 +08:00
parent 33a2ae3d16
commit f6415724be
Signed by: Shikong
GPG Key ID: BD85FF18B373C341

View File

@ -10,21 +10,23 @@
- [Rust 程序设计语言](https://kaisery.github.io/trpl-zh-cn/) - [Rust 程序设计语言](https://kaisery.github.io/trpl-zh-cn/)
## 子包创建 ## 子包
### 通用
#### 新建子包
例子: 例子:
```shell ```shell
cargo new 5.function --name function cargo new 5.function --name function
``` ```
### 编译某个子包 #### 编译某个子包
```shell ```shell
cargo build --manifest-path 5.function/Cargo.toml cargo build --manifest-path 5.function/Cargo.toml
``` ```
### 运行某个子包 #### 运行某个子包
```shell ```shell
cargo run --manifest-path 5.function/Cargo.toml cargo run --manifest-path 5.function/Cargo.toml
``` ```
### 工作空间 workspace ### 基于 工作空间 workspace 管理子包
参考文档 参考文档
- https://course.rs/cargo/reference/workspaces.html - https://course.rs/cargo/reference/workspaces.html