Macro textwrap_macros::wrap [−][src]
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."]);