Macro repeat
macro_rules! repeat {
($s: expr, $n: expr) => { ... };
}
Available on crate feature
dep_const_str
only.Expand description
Creates a new string slice by repeating a string slice n times.
ยงExamples
const S: &str = "abc";
const SSSS: &str = const_str::repeat!(S, 4);
assert_eq!(SSSS, "abcabcabcabc");