From 8a905a87780a6898b5fea6b39db7b6fcae8e84cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Sun, 24 Mar 2019 18:25:10 +0100 Subject: [PATCH] put rustfmt::skip::macro mention together with the rustfmt::skip bullet point --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2738363160a..cc5fb979c52 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,18 @@ needs to be specified in `rustfmt.toml`, e.g., with `edition = "2018"`. ## Tips * For things you do not want rustfmt to mangle, use `#[rustfmt::skip]` +* To prevent rustfmt from formatting a macro, + use `#[rustfmt::skip::macros(target_macro_name)]` + + Example: + + ```rust + #[rustfmt::skip::macros(html)] + fn main() { + let macro_result1 = html! {
+ Hello
+ }.to_string(); + ``` * When you run rustfmt, place a file named `rustfmt.toml` or `.rustfmt.toml` in target file directory or its parents to override the default settings of rustfmt. You can generate a file containing the default configuration with @@ -205,19 +217,6 @@ needs to be specified in `rustfmt.toml`, e.g., with `edition = "2018"`. | coverage | displays how much of the input file was processed | Yes | | checkstyle | emits in a checkstyle format | Yes | -* To prevent rustfmt from formatting a macro, - use `#[rustfmt::skip::macros(target_macro_name)]` - - Example: - -```rust -#[rustfmt::skip::macros(html)] -fn main() { - let macro_result1 = html! {
-Hello
- }.to_string(); -``` - ## License Rustfmt is distributed under the terms of both the MIT license and the