diff --git a/src/protocol/arena.rs b/src/protocol/arena.rs index e55efe6a0da9a3f0b48378dedb3f230847a216a1..1e4b64f9ae2b6d7e47f4e24d33b1a6a1b3b7d905 100644 --- a/src/protocol/arena.rs +++ b/src/protocol/arena.rs @@ -1,11 +1,23 @@ +use crate::common::*; use core::hash::Hash; use core::marker::PhantomData; -#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] pub struct Id { index: u32, _phantom: PhantomData, } +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct Arena { + store: Vec, +} +////////////////////////////////// + +impl Debug for Id { + fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { + f.debug_struct("Id").field("index", &self.index).finish() + } +} impl Clone for Id { fn clone(&self) -> Self { *self @@ -23,11 +35,6 @@ impl Hash for Id { self.index.hash(h); } } - -#[derive(Debug, serde::Serialize, serde::Deserialize)] -pub struct Arena { - store: Vec, -} impl Arena { pub fn new() -> Self { Self { store: vec![] }