Link Search Menu Expand Document


Tool for formatting Rust source code. More information:

  • Format a file, overwriting the original file in-place:

rustfmt {{path/to/}}

  • Check a file for formatting and display any changes on the console:

rustfmt --check {{path/to/}}

  • Backup any modified files before formatting (the original file is renamed with a .bk extension):

rustfmt --backup {{path/to/}}