#string-literal #literals #string #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

#2067 in Rust patterns

Download history 933/week @ 2024-03-14 804/week @ 2024-03-21 681/week @ 2024-03-28 715/week @ 2024-04-04 1037/week @ 2024-04-11 910/week @ 2024-04-18 759/week @ 2024-04-25 816/week @ 2024-05-02 753/week @ 2024-05-09 963/week @ 2024-05-16 981/week @ 2024-05-23 1456/week @ 2024-05-30 1155/week @ 2024-06-06 1068/week @ 2024-06-13 998/week @ 2024-06-20 614/week @ 2024-06-27

4,137 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