add new chinese translations

This commit is contained in:
2024-12-30 15:25:56 +08:00
parent a850046d7b
commit 0d798759fd
5418 changed files with 105800 additions and 7052 deletions

View File

@@ -1,32 +1,32 @@
# cargo add
> 向 Rust 项目的 `Cargo.toml` 文件添加依赖项。
> 更多信息:<https://doc.rust-lang.org/cargo/commands/cargo-add.html>.
> 向 Rust 项目的 `Cargo.toml` 清单添加依赖项。
> 更多信息:<https://doc.rust-lang.org/cargo/commands/cargo-add.html>
- 将最新版本的依赖项添加到当前项目
- 向当前项目添加依赖项的最新版本
`cargo add {{依赖项}}`
`cargo add {{dependency}}`
- 添加特定版本的依赖项:
`cargo add {{依赖项}}@{{版本号}}`
`cargo add {{dependency}}@{{version}}`
- 添加依赖项并启一个或多个特定功能:
- 添加依赖项并启一个或多个特定功能:
`cargo add {{依赖项}} --features {{功能1}},{{功能2}}`
`cargo add {{dependency}} --features {{feature_1}},{{feature_2}}`
- 添加一个可选依赖项,然后将其作为包(crate)的一个功能暴露出来
- 添加一个可选依赖项,该依赖项将作为 crate 的一个功能暴露:
`cargo add {{依赖项}} --optional`
`cargo add {{dependency}} --optional`
- 将本地包(crate)添加为依赖项:
- 将本地 crate 添加为依赖项:
`cargo add --path {{path/to/directory}}`
`cargo add --path {{path/to/crate_directory}}`
- 添加一个开发或构建依赖项:
- 添加开发或构建依赖项:
`cargo add {{依赖项}} --{{dev|build}}`
`cargo add {{dependency}} --{{dev|build}}`
- 添加一个禁用所有默认功能的依赖项:
- 添加禁用所有默认功能的依赖项:
`cargo add {{依赖项}} --no-default-features`
`cargo add {{dependency}} --no-default-features`