09-cargo fmt

cargo-fmt(1) 格式化代码

译文 · 基于 The Cargo Book

cargo-fmt(1)

原文链接: https://doc.rust-lang.org/cargo/commands/cargo-fmt.html

名称

cargo-fmt — 使用 rustfmt 格式化当前 crate 的所有 bin 与 lib 文件

描述

这是随 Rust 工具链分发的可选组件中的外部命令。 它并非内置于 Cargo,可能需要额外安装。

关于用法与安装,请参阅 https://github.com/rust-lang/rustfmt。

参见

cargo(1)、 cargo-fix(1)、 cargo-clippy(1)、 自定义子命令

最后修改 August 11, 2026: 更新 (70a5af133)