diff options
author | Galilée 'Bill' Enguehard <[email protected]> | 2020-05-21 22:27:38 +0100 |
---|---|---|
committer | Galilée 'Bill' Enguehard <[email protected]> | 2020-05-21 22:27:38 +0100 |
commit | 7fece3bdd2450c0807f7dd742239cae95f0cc65e (patch) | |
tree | 866c4db826c959e79c63a6727bdb9f2c61e6fc4f /crates/ra_tt | |
parent | db926218b2082077750291f8426ddd28b284cd08 (diff) | |
parent | 59732df8d40dfadc6dcf5951265416576399712a (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer into modname_spacing
Diffstat (limited to 'crates/ra_tt')
-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), |