rustfmt
The tool that formats Rust code in the standard style.
rustfmt rewrites source files into the community-standard layout; cargo fmt runs it on a whole project.
Examples
cargo fmtrewritesfn main(){asfn main() {with four-space indents;cargo fmt --checkonly shows the diff and exits with status 1.