From: Ian Jackson Date: Sat, 29 Oct 2022 21:29:07 +0000 (+0100) Subject: add Clone X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=1a7955f01a947decaa769dfeeae622e7987642f2;p=z3-treefoil add Clone Signed-off-by: Ian Jackson --- 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],