4 releases (2 breaking)

0.2.0 Oct 29, 2024
0.1.2 Oct 29, 2024
0.1.1 May 8, 2021
0.1.0 Apr 8, 2021
0.0.0 Apr 8, 2021

#323 in Rust patterns

Download history 588/week @ 2024-09-26 404/week @ 2024-10-03 636/week @ 2024-10-10 752/week @ 2024-10-17 931/week @ 2024-10-24 1019/week @ 2024-10-31 580/week @ 2024-11-07 413/week @ 2024-11-14 794/week @ 2024-11-21 654/week @ 2024-11-28 984/week @ 2024-12-05 785/week @ 2024-12-12 430/week @ 2024-12-19 205/week @ 2024-12-26 613/week @ 2025-01-02 721/week @ 2025-01-09

2,136 downloads per month
Used in 10 crates (4 directly)

MIT license

4KB

Text Block Macros

Test Crates.io Version

Create a multiline string literal.

Usage Examples

Create a block of text without final newline

use text_block_macros::text_block;
let text = text_block! {
  "abc"
  "def"
  "ghi"
};
assert_eq!(text, "abc\ndef\nghi");

Create a block of text that ends with a newline

use text_block_macros::text_block_fnl;
let text = text_block_fnl! {
  "abc"
  "def"
  "ghi"
};
assert_eq!(text, "abc\ndef\nghi\n");

License

MIT © Hoàng Văn Khải.

No runtime deps