diff options
author | Aleksey Kladov <[email protected]> | 2019-01-10 19:47:05 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-10 21:51:34 +0000 |
commit | 8852408bfb358766d59b83f294148fb5eeae26a0 (patch) | |
tree | 1bca8af9f6ac8f668d8ca5a710b6677c6b90e921 /crates/ra_arena | |
parent | 66fba88534039ff42a230f1ede3e0a730f61ad3c (diff) |
use arena for sysroot
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) => { |