Macro textwrap_macros::wrap[][src]

macro_rules! wrap {
    #[proc_macro_hack::proc_macro_hack] => { ... };
}

Wrap a line of text at width characters.

Strings are wrapped based on their displayed width, not their size in bytes.

Usage

wrap!($text: lit &str, $width: lit usize) -> lit &[ lit &str ]

Example

use textwrap_macros::wrap;

const LINES: &[&str] = wrap!("Concurrency without data races.", 15);
assert_eq!(LINES, ["Concurrency", "without data", "races."]);