an @-sign in a box

This commit is contained in:
Griffin Smith 2019-07-05 22:45:57 -04:00
commit de081d7b1d
19 changed files with 2024 additions and 0 deletions

9
src/display/utils.rs Normal file
View file

@ -0,0 +1,9 @@
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()
}