str_repeat_bytes!() { /* proc-macro */ }Expand description
Procedural macro proc_strarray::str_repeat_bytes! repeats str or byte str
literal as byte slice.
Arguments are same as str_repeat! only returned type is byte slice.
ยงSee also
str_repeat!: repeat str or bytestr literal.
// This code will repeat string "AB" 2 times.
use proc_strarray::str_repeat_bytes;
const S: &[u8] = str_repeat_bytes!("AB", 2);
assert_eq!(S.len(), 4);
assert_eq!(S, b"ABAB");