From ea032f0a48c2d93f6add6550fdec5d756fba45a6 Mon Sep 17 00:00:00 2001 From: Fazle Arefin Date: Tue, 10 Jun 2025 21:21:40 +1000 Subject: [PATCH] rustfmt: add examples (#16807) --- pages/common/rustfmt.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pages/common/rustfmt.md b/pages/common/rustfmt.md index 20db1802ce..a11de8a592 100644 --- a/pages/common/rustfmt.md +++ b/pages/common/rustfmt.md @@ -14,3 +14,11 @@ - Backup any modified files before formatting (the original file is renamed with a `.bk` extension): `rustfmt --backup {{path/to/source.rs}}` + +- Format code using a specific Rust style edition (formatting rules) verbosely: + +`rustfmt --style-edition {{2015|2018|2021|2024}} {{[-v|--verbose]}} {{path/to/source1.rs path/to/source2.rs ...}}` + +- Format code using a specific Rust edition (language features and parsing): + +`rustfmt --edition {{2015|2018|2021|2024}} {{path/to/source1.rs path/to/source2.rs ...}}`