From 193b1a7437c97064a51f0c30a175665b5d6c9895 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 4 Dec 2019 17:15:55 +0100 Subject: :arrow_up: rowan --- crates/ra_syntax/Cargo.toml | 2 +- crates/ra_syntax/src/algo.rs | 12 ++++++------ crates/ra_syntax/src/syntax_node.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index 5db2b58c0..1c0b184e1 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] itertools = "0.8.0" -rowan = "0.7.0" +rowan = "0.8.0" rustc_lexer = "0.1.0" rustc-hash = "1.0.1" arrayvec = "0.5.1" diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs index 1c075082a..e4061e994 100644 --- a/crates/ra_syntax/src/algo.rs +++ b/crates/ra_syntax/src/algo.rs @@ -140,13 +140,13 @@ pub fn insert_children( }); let new_children = match &position { - InsertPosition::First => to_insert.chain(old_children).collect::>(), - InsertPosition::Last => old_children.chain(to_insert).collect::>(), + InsertPosition::First => to_insert.chain(old_children).collect::>(), + InsertPosition::Last => old_children.chain(to_insert).collect::>(), InsertPosition::Before(anchor) | InsertPosition::After(anchor) => { let take_anchor = if let InsertPosition::After(_) = position { 1 } else { 0 }; let split_at = position_of_child(parent, anchor.clone()) + take_anchor; let before = old_children.by_ref().take(split_at).collect::>(); - before.into_iter().chain(to_insert).chain(old_children).collect::>() + before.into_iter().chain(to_insert).chain(old_children).collect::>() } }; @@ -174,7 +174,7 @@ pub fn replace_children( .into_iter() .chain(to_insert.map(to_green_element)) .chain(old_children.skip(end + 1 - start)) - .collect::>(); + .collect::>(); with_children(parent, new_children) } @@ -187,7 +187,7 @@ pub fn replace_descendants( map: &FxHashMap, ) -> SyntaxNode { // FIXME: this could be made much faster. - let new_children = parent.children_with_tokens().map(|it| go(map, it)).collect::>(); + let new_children = parent.children_with_tokens().map(|it| go(map, it)).collect::>(); return with_children(parent, new_children); fn go( @@ -211,7 +211,7 @@ pub fn replace_descendants( fn with_children( parent: &SyntaxNode, - new_children: Box<[NodeOrToken]>, + new_children: Vec>, ) -> SyntaxNode { let len = new_children.iter().map(|it| it.text_len()).sum::(); let new_node = diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index b2f5b8c64..041c6ea8d 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs @@ -40,7 +40,7 @@ pub use rowan::{Direction, NodeOrToken}; pub struct SyntaxTreeBuilder { errors: Vec, - inner: GreenNodeBuilder, + inner: GreenNodeBuilder<'static>, } impl Default for SyntaxTreeBuilder { -- cgit v1.2.3