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

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

#1880 in Rust patterns

Download history 2572/week @ 2023-11-18 3429/week @ 2023-11-25 1602/week @ 2023-12-02 1119/week @ 2023-12-09 953/week @ 2023-12-16 230/week @ 2023-12-23 1215/week @ 2023-12-30 1282/week @ 2024-01-06 794/week @ 2024-01-13 1483/week @ 2024-01-20 1121/week @ 2024-01-27 1083/week @ 2024-02-03 1004/week @ 2024-02-10 717/week @ 2024-02-17 944/week @ 2024-02-24 1080/week @ 2024-03-02

3,965 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