Macro str_repeat_bytes0

Source
str_repeat_bytes0!() { /* proc-macro */ }
Expand description

Procedural macro proc_strarray::str_repeat_bytes0! repeats str or byte str literal as byte slice with added \0.

Arguments are same as str_repeat0! only returned type is byte slice.

ยงSee also

    // This code will repeat string "AB" 2 times.
    use proc_strarray::str_repeat_bytes0;
    const S: &[u8] = str_repeat_bytes0!("AB", 2);
    assert_eq!(S.len(), 5);
    assert_eq!(S, b"ABAB\0");