mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
types: add Clone + Debug to ChunkArray iterators
Added for consistency with LayerBlockArray.
This commit is contained in:
parent
921a218d56
commit
789a4002c7
1 changed files with 3 additions and 3 deletions
|
@ -116,15 +116,15 @@ impl Debug for ChunkCoords {
|
|||
pub struct ChunkArray<T>(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]);
|
||||
|
||||
impl<T> ChunkArray<T> {
|
||||
pub fn keys() -> impl Iterator<Item = ChunkCoords> {
|
||||
pub fn keys() -> impl Iterator<Item = ChunkCoords> + Clone + Debug {
|
||||
iproduct!(ChunkZ::iter(), ChunkX::iter()).map(|(z, x)| ChunkCoords { x, z })
|
||||
}
|
||||
|
||||
pub fn values(&self) -> impl Iterator<Item = &T> {
|
||||
pub fn values(&self) -> impl Iterator<Item = &T> + Clone + Debug {
|
||||
Self::keys().map(|k| &self[k])
|
||||
}
|
||||
|
||||
pub fn iter(&self) -> impl Iterator<Item = (ChunkCoords, &T)> {
|
||||
pub fn iter(&self) -> impl Iterator<Item = (ChunkCoords, &T)> + Clone + Debug {
|
||||
Self::keys().map(|k| (k, &self[k]))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue