Rust Formatter
Format Rust code — rustfmt-style indentation and spacing.
About Rust Formatter
rustfmt is the official Rust code formatter, included with the Rust toolchain. Like gofmt, it produces deterministic output with minimal configuration. Run it with cargo fmt. The Rust Style Guide specifies 4-space indentation, trailing commas in multi-line constructs, and maximum 100-character line length. rustfmt is integrated with Cargo and runs automatically in cargo check and during CI.
FAQ
How do I disable rustfmt for a specific block?
Use #[rustfmt::skip] attribute on a function, struct, or impl block: #[rustfmt::skip] fn my_matrix() { ... }. For specific expressions, use // rustfmt::skip comments. Use this sparingly — usually for manually-aligned code like lookup tables, matrices, or ASCII art where automatic formatting reduces readability.