Function display_utils::repeat [−][src]
pub fn repeat<T: Display>(token: T, times: usize) -> Repeat<T>
Repeat an object a certain number of times.
Equivalent to str::repeat
.
assert_eq!(repeat("fun", 5).to_string(), "funfunfunfunfun"); assert_eq!(repeat(7, 7).to_string(), "7777777");