#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

#1234 in Rust patterns

Download history 217/week @ 2022-10-12 268/week @ 2022-10-19 171/week @ 2022-10-26 140/week @ 2022-11-02 135/week @ 2022-11-09 185/week @ 2022-11-16 190/week @ 2022-11-23 143/week @ 2022-11-30 224/week @ 2022-12-07 182/week @ 2022-12-14 163/week @ 2022-12-21 86/week @ 2022-12-28 104/week @ 2023-01-04 95/week @ 2023-01-11 118/week @ 2023-01-18 215/week @ 2023-01-25

549 downloads per month
Used in 6 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