rustfmt
格式化 Rust 源代码。 更多信息:https://github.com/rust-lang/rustfmt。
- 格式化文件,就地覆盖原始文件:
rustfmt
- 检查文件的格式并在控制台显示所有变更:
rustfmt --check
- 在格式化前备份所有修改的文件(原始文件会以
.bk扩展名重命名):
rustfmt --backup
- 使用特定的 Rust 风格版次(格式化规则)以详细模式格式化代码:
rustfmt --style-edition
- 使用特定的 Rust 版次(语言特性和解析)格式化代码:
rustfmt --edition
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
