mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-13 02:09:07 +02:00
treewide: update to bincode 2
Consistently use bincode's Encode/Decode to avoid issues with incompatible serde features. Support for storing some temporary files as JSON is removed. The size of the "processed" directory is reduced by ~8% with the new default encoding of bincode 2. Performance is more or less unaffected.
This commit is contained in:
parent
404ad74235
commit
53a0f24600
16 changed files with 133 additions and 81 deletions
|
@ -8,8 +8,8 @@ use std::{
|
|||
ops::{Index, IndexMut},
|
||||
};
|
||||
|
||||
use bincode::{Decode, Encode};
|
||||
use itertools::iproduct;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Const generic AXIS arguments for coordinate types
|
||||
pub mod axis {
|
||||
|
@ -110,7 +110,7 @@ impl LayerBlockCoords {
|
|||
/// Generic array for data stored per block of a chunk layer
|
||||
///
|
||||
/// Includes various convenient iteration functions.
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, Default, Encode, Decode)]
|
||||
pub struct LayerBlockArray<T>(pub [[T; BLOCKS_PER_CHUNK]; BLOCKS_PER_CHUNK]);
|
||||
|
||||
impl<T> Index<LayerBlockCoords> for LayerBlockArray<T> {
|
||||
|
@ -196,7 +196,7 @@ impl Debug for ChunkCoords {
|
|||
/// Generic array for data stored per chunk of a region
|
||||
///
|
||||
/// Includes various convenient iteration functions.
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, Default, Encode, Decode)]
|
||||
pub struct ChunkArray<T>(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]);
|
||||
|
||||
impl<T> ChunkArray<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue