diff options
Diffstat (limited to 'crates/ra_arena')
-rw-r--r-- | crates/ra_arena/src/lib.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_arena/src/lib.rs b/crates/ra_arena/src/lib.rs index 43bfa925a..d7d5d5265 100644 --- a/crates/ra_arena/src/lib.rs +++ b/crates/ra_arena/src/lib.rs | |||
@@ -35,12 +35,21 @@ impl fmt::Display for RawId { | |||
35 | } | 35 | } |
36 | } | 36 | } |
37 | 37 | ||
38 | #[derive(Clone, Debug, PartialEq, Eq)] | 38 | #[derive(Clone, PartialEq, Eq)] |
39 | pub struct Arena<ID: ArenaId, T> { | 39 | pub struct Arena<ID: ArenaId, T> { |
40 | data: Vec<T>, | 40 | data: Vec<T>, |
41 | _ty: PhantomData<ID>, | 41 | _ty: PhantomData<ID>, |
42 | } | 42 | } |
43 | 43 | ||
44 | impl<ID: ArenaId, T: fmt::Debug> fmt::Debug for Arena<ID, T> { | ||
45 | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { | ||
46 | fmt.debug_struct("Arena") | ||
47 | .field("len", &self.len()) | ||
48 | .field("data", &self.data) | ||
49 | .finish() | ||
50 | } | ||
51 | } | ||
52 | |||
44 | #[macro_export] | 53 | #[macro_export] |
45 | macro_rules! impl_arena_id { | 54 | macro_rules! impl_arena_id { |
46 | ($name:ident) => { | 55 | ($name:ident) => { |