From 1a7955f01a947decaa769dfeeae622e7987642f2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 29 Oct 2022 22:29:07 +0100 Subject: [PATCH] add Clone Signed-off-by: Ian Jackson --- src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5cf9d5f..daca166 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,7 +40,9 @@ pub fn shape_abut_zero(shape: &mut Shape) { } } -pub fn shape_edges(shape: &Shape) -> impl Iterator + '_ { +pub fn shape_edges(shape: &Shape) + -> impl Iterator + Clone + '_ +{ shape .iter() .cycle() @@ -53,7 +55,9 @@ fn flip_coord(do_flip: bool, c: Coord) -> Coord { if do_flip { MAX-c } else { c } } -pub fn shape_all_flippings(shape: &Shape) -> impl Iterator + '_ { +pub fn shape_all_flippings(shape: &Shape) + -> impl Iterator + Clone + '_ +{ iter::repeat([false,true].into_iter()) .take(DIM) .multi_cartesian_product() @@ -66,7 +70,9 @@ pub fn shape_all_flippings(shape: &Shape) -> impl Iterator + '_ { }) } -pub fn shape_all_rotations(shape: &Shape) -> impl Iterator + '_ { +pub fn shape_all_rotations(shape: &Shape) + -> impl Iterator + Clone + '_ +{ Itertools::cartesian_product( 0..DIM, [false,true], -- 2.30.2