From 8a44d2efe9db7ce76c33d5d28fe10af5b60ba7cb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 29 Oct 2022 22:32:16 +0100 Subject: [PATCH] edges in other order Signed-off-by: Ian Jackson --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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]) } -- 2.30.2