1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 17:22:10 +02:00
tldr/pages/common/rustfmt.md
Vitor Henrique c8f956319f
pages*: simplify page description (#12149)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-02-14 21:25:13 +01:00

16 lines
445 B
Markdown

# rustfmt
> Format Rust source code.
> More information: <https://github.com/rust-lang/rustfmt>.
- Format a file, overwriting the original file in-place:
`rustfmt {{path/to/source.rs}}`
- Check a file for formatting and display any changes on the console:
`rustfmt --check {{path/to/source.rs}}`
- Backup any modified files before formatting (the original file is renamed with a `.bk` extension):
`rustfmt --backup {{path/to/source.rs}}`