rustfmt
6.7#2 in code formattersFree planFree planLinuxmacOSWindows
Visit| Fact | rustfmt | Zig fmt |
|---|---|---|
| Check mode | With `--check`, rustfmt exits with code 0 when no formatting changes are needed and 1 when changes would be made. | The `--check` flag lists nonconforming files on stdout and exits with an error if the list is nonempty, without modifying file contents. |
| Editor integrations | The README lists integrations or usage instructions for Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, and IntelliJ or CLion. | The release notes cite integrations for Vim and VSCode. |
| Purpose | rustfmt formats Rust code according to style guidelines. | `zig fmt` formats Zig code to a canonical style. |
rustfmt suits Rust developers who want consistent formatting through Cargo, an editor, or CI. It is also relevant to developers who need configurable formatting behavior.
Zig developers who want a consistent format for source files can use Zig fmt, whether running it on a whole codebase or a subset. Its check mode also suits workflows that need to identify nonconforming files without modifying them.