2018-09-11 19:04:32 +01:00
|
|
|
# rustfmt
|
|
|
|
|
|
|
|
> Tool for formatting Rust source code.
|
2019-05-15 09:23:58 +01:00
|
|
|
> Homepage: <https://github.com/rust-lang/rustfmt>.
|
2018-09-11 19:04:32 +01:00
|
|
|
|
|
|
|
- Format a file, overwriting the original file in-place:
|
|
|
|
|
|
|
|
`rustfmt {{source.rs}}`
|
|
|
|
|
|
|
|
- Check a file for formatting and display any changes on the console:
|
|
|
|
|
|
|
|
`rustfmt --check {{source.rs}}`
|
|
|
|
|
|
|
|
- Backup any modified files before formatting (the original file is renamed with a `.bk` extension):
|
|
|
|
|
|
|
|
`rustfmt --backup {{source.rs}}`
|