diff options
Diffstat (limited to 'crates/ra_tt/src')
-rw-r--r-- | crates/ra_tt/src/buffer.rs | 4 | ||||
-rw-r--r-- | crates/ra_tt/src/lib.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_tt/src/buffer.rs b/crates/ra_tt/src/buffer.rs index 14b3f707d..5967f44cd 100644 --- a/crates/ra_tt/src/buffer.rs +++ b/crates/ra_tt/src/buffer.rs | |||
@@ -42,7 +42,9 @@ impl<'t> TokenBuffer<'t> { | |||
42 | buffers: &mut Vec<Box<[Entry<'t>]>>, | 42 | buffers: &mut Vec<Box<[Entry<'t>]>>, |
43 | next: Option<EntryPtr>, | 43 | next: Option<EntryPtr>, |
44 | ) -> usize { | 44 | ) -> usize { |
45 | let mut entries = vec![]; | 45 | // Must contain everything in tokens and then the Entry::End |
46 | let start_capacity = tokens.len() + 1; | ||
47 | let mut entries = Vec::with_capacity(start_capacity); | ||
46 | let mut children = vec![]; | 48 | let mut children = vec![]; |
47 | 49 | ||
48 | for (idx, tt) in tokens.iter().enumerate() { | 50 | for (idx, tt) in tokens.iter().enumerate() { |
diff --git a/crates/ra_tt/src/lib.rs b/crates/ra_tt/src/lib.rs index 5248e026c..342ddbe32 100644 --- a/crates/ra_tt/src/lib.rs +++ b/crates/ra_tt/src/lib.rs | |||
@@ -243,7 +243,7 @@ impl Subtree { | |||
243 | 243 | ||
244 | pub mod buffer; | 244 | pub mod buffer; |
245 | 245 | ||
246 | #[derive(Debug, PartialEq, Eq)] | 246 | #[derive(Debug, PartialEq, Eq, Clone)] |
247 | pub enum ExpansionError { | 247 | pub enum ExpansionError { |
248 | IOError(String), | 248 | IOError(String), |
249 | JsonError(String), | 249 | JsonError(String), |