From 789a4002c772320bad4a25ca85eac0dbf0eba43a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 15 Feb 2023 00:47:59 +0100 Subject: [PATCH] types: add Clone + Debug to ChunkArray iterators Added for consistency with LayerBlockArray. --- src/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types.rs b/src/types.rs index 39b106f..3a0bb22 100644 --- a/src/types.rs +++ b/src/types.rs @@ -116,15 +116,15 @@ impl Debug for ChunkCoords { pub struct ChunkArray(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]); impl ChunkArray { - pub fn keys() -> impl Iterator { + pub fn keys() -> impl Iterator + Clone + Debug { iproduct!(ChunkZ::iter(), ChunkX::iter()).map(|(z, x)| ChunkCoords { x, z }) } - pub fn values(&self) -> impl Iterator { + pub fn values(&self) -> impl Iterator + Clone + Debug { Self::keys().map(|k| &self[k]) } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator + Clone + Debug { Self::keys().map(|k| (k, &self[k])) } }