#string #literal #text #block #multi-line

no-std text-block-macros

Create a multiline string literal

3 unstable releases

0.1.1 May 8, 2021
0.1.0 Apr 8, 2021
0.0.0 Apr 8, 2021

#679 in Rust patterns

Download history 151/week @ 2022-01-26 76/week @ 2022-02-02 162/week @ 2022-02-09 246/week @ 2022-02-16 149/week @ 2022-02-23 175/week @ 2022-03-02 66/week @ 2022-03-09 54/week @ 2022-03-16 52/week @ 2022-03-23 184/week @ 2022-03-30 188/week @ 2022-04-06 391/week @ 2022-04-13 53/week @ 2022-04-20 169/week @ 2022-04-27 164/week @ 2022-05-04 103/week @ 2022-05-11

639 downloads per month
Used in 3 crates (2 directly)

MIT license

3KB

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