Format Rust Code - cargo-fmt | Online Free DevTools by Hexmos

Format Rust code quickly with cargo-fmt. Improve code readability and maintain consistent style across your projects. Free online tool, no registration required.

cargo fmt

Run rustfmt on all source files in a Rust project. More information: https://github.com/rust-lang/rustfmt.

  • Format all source files:

cargo fmt

  • Check for formatting errors without writing to the files:

cargo fmt --check

  • Pass arguments to each rustfmt call:

cargo fmt -- {{rustfmt_args}}