1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/rustfmt.md

17 lines
445 B
Markdown
Raw Normal View History

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