From: Ian Jackson Date: Sat, 29 Oct 2022 21:32:16 +0000 (+0100) Subject: edges in other order X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=8a44d2efe9db7ce76c33d5d28fe10af5b60ba7cb;p=z3-treefoil edges in other order Signed-off-by: Ian Jackson --- diff --git a/src/lib.rs b/src/lib.rs index daca166..1a16205 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ pub use std::io; pub use std::io::Write as _; pub use std::iter; -pub use itertools::izip; +pub use itertools::{chain, izip}; pub use itertools::Itertools; pub fn default() -> T { Default::default() } @@ -43,10 +43,10 @@ pub fn shape_abut_zero(shape: &mut Shape) { pub fn shape_edges(shape: &Shape) -> impl Iterator + Clone + '_ { - shape - .iter() - .cycle() - .take(shape.len() + 1) + chain!( + shape.iter().rev().take(1), + shape, + ) .tuple_windows() .map(|(&a,&b)| [a,b]) }