Browse Source

rustfmt: add page (#2318) (#2319)

Muhammad Falak R Wani 6 years ago
parent
commit
61f9589496
1 changed files with 15 additions and 0 deletions
  1. 15 0
      pages/common/rustfmt.md

+ 15 - 0
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}}`