textwrap-macros 0.3.0

Simple procedural macros to use textwrap utilities at compile time.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![cfg_attr(not(feature = "std"), no_std)]

#[macro_use]
extern crate textwrap_macros;

#[test]
fn test_constant() {
    const X: &str = indent!("abc\ndef\nghi\njkl\n", "- ");
    const Y: &str = "- abc\n- def\n- ghi\n- jkl\n";
    assert_eq!(X, Y);
}

#[test]
fn test_static() {
    static X: &str = indent!("abc\ndef\nghi\njkl\n", "- ");
    static Y: &str = "- abc\n- def\n- ghi\n- jkl\n";
    assert_eq!(X, Y);
}