Function fmty::repeat

source ·
pub fn repeat<T>(value: T, n: usize) -> Repeat<T>
Expand description

Repeats a value n times.

This is a non-allocating alternative to [T]::repeat() or str::repeat().

Examples

let value = fmty::repeat("123", 3);
assert_eq!(value.to_string(), "123123123");