text-block-macros

Crates.iotext-block-macros
lib.rstext-block-macros
version0.2.0
sourcesrc
created_at2021-04-08 10:49:56.310962
updated_at2024-10-29 21:16:47.089101
descriptionCreate a multiline string literal
homepage
repositoryhttps://github.com/KSXGitHub/text-block-macros.git
max_upload_size
id380790
size5,778
Khải (KSXGitHub)

documentation

https://docs.rs/text-block-macros

README

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.

Commit count: 47

cargo fmt