add explanation for rustfmt::skip::macros
This commit is contained in:
parent
f493a59783
commit
558a2c3512
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
@ -205,6 +205,19 @@ 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 |
|
||||
|
||||
* For things you do not want rustfmt to mangle for some macro,
|
||||
use `#[rustfmt::skip::macros(target_macro_name)]`
|
||||
|
||||
Example:
|
||||
|
||||
```rust
|
||||
#[rustfmt::skip::macros(html)]
|
||||
fn main() {
|
||||
let macro_result1 = html! { <div>
|
||||
Hello</div>
|
||||
}.to_string();
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Rustfmt is distributed under the terms of both the MIT license and the
|
||||
|
|
Loading…
Add table
Reference in a new issue