第12章 cargo

cargo — Rust By Example

译文 · 基于 Rust By Example

原文链接: https://doc.rust-lang.org/stable/rust-by-example/cargo.html

cargo

cargo 是官方的 Rust 包管理工具。 它有很多非常有用的功能来提高代码质量和开发人员的开发效率! 这些功能包括:

  • 依赖管理和与 crates.io(官方 Rust 包注册服务)集成
  • 方便的单元测试
  • 方便的基准测试

本章将介绍一些快速入门的基础知识,不过你可以在 cargo 官方手册中找到详细内容。


01-依赖

依赖 — Rust By Example

02-约定规范

约定规范 — Rust By Example

03-测试

测试 — Rust By Example

04-构建脚本

构建脚本 — Rust By Example

最后修改 August 21, 2026: 更新 (76fc81a2e)