text-block-macros 0.2.0

Create a multiline string literal
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 5.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 139.23 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • KSXGitHub/text-block-macros
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • KSXGitHub

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.