From 61f95894965e787e78de5fb648f5b9062811d64b Mon Sep 17 00:00:00 2001 From: Muhammad Falak R Wani Date: Tue, 11 Sep 2018 23:34:32 +0530 Subject: [PATCH] rustfmt: add page (#2318) (#2319) --- pages/common/rustfmt.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/common/rustfmt.md diff --git a/pages/common/rustfmt.md b/pages/common/rustfmt.md new file mode 100644 index 00000000000000..0226eadf71b314 --- /dev/null +++ b/pages/common/rustfmt.md @@ -0,0 +1,15 @@ +# rustfmt + +> Tool for formatting Rust source code. + +- 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}}`