Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8a905a8

Browse files
authored
put rustfmt::skip::macro mention together with the rustfmt::skip bullet point
1 parent 85b206a commit 8a905a8

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,18 @@ needs to be specified in `rustfmt.toml`, e.g., with `edition = "2018"`.
179179
## Tips
180180

181181
* For things you do not want rustfmt to mangle, use `#[rustfmt::skip]`
182+
* To prevent rustfmt from formatting a macro,
183+
use `#[rustfmt::skip::macros(target_macro_name)]`
184+
185+
Example:
186+
187+
```rust
188+
#[rustfmt::skip::macros(html)]
189+
fn main() {
190+
let macro_result1 = html! { <div>
191+
Hello</div>
192+
}.to_string();
193+
```
182194
* When you run rustfmt, place a file named `rustfmt.toml` or `.rustfmt.toml` in
183195
target file directory or its parents to override the default settings of
184196
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"`.
205217
| coverage | displays how much of the input file was processed | Yes |
206218
| checkstyle | emits in a checkstyle format | Yes |
207219

208-
* To prevent rustfmt from formatting a macro,
209-
use `#[rustfmt::skip::macros(target_macro_name)]`
210-
211-
Example:
212-
213-
```rust
214-
#[rustfmt::skip::macros(html)]
215-
fn main() {
216-
let macro_result1 = html! { <div>
217-
Hello</div>
218-
}.to_string();
219-
```
220-
221220
## License
222221

223222
Rustfmt is distributed under the terms of both the MIT license and the

0 commit comments

Comments
 (0)