Implement dedent proc_macro
This commit is contained in:
commit
57079b4cd3
4 changed files with 224 additions and 0 deletions
24
readme.md
Normal file
24
readme.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# dedent
|
||||
|
||||
A procedural macro that removes leading indentation from string literals.
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
dedent = { version = "0.1", registry = "nettika" }
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```rust
|
||||
use dedent::dedent;
|
||||
|
||||
let xml = dedent! {r#"
|
||||
<root>
|
||||
<item id="3"/>
|
||||
</root>
|
||||
"#};
|
||||
|
||||
assert_eq!(xml, r#"<root>
|
||||
<item id="3"/>
|
||||
</root>"#);
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue