blob: acd4416cb884430064c88e6b50f69f7915585e5e (
plain) (
tree)
|
|
use std::iter::FromIterator;
pub fn times<A: Copy, B: FromIterator<A>>(elem: A, n: u16) -> B {
(0..n).map(|_| elem).collect()
}
pub fn clone_times<A: Clone, B: FromIterator<A>>(elem: A, n: u16) -> B {
(0..n).map(|_| elem.clone()).collect()
}
|