Skip to content

Commit 1fe0b8c

Browse files
bors[bot]matklad
andauthored
Merge #2476
2476: ⬆️ rowan r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 035419a + 193b1a7 commit 1fe0b8c

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ incremental = true
1111
debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger
1212

1313
[patch.'crates-io']
14+
# rowan = { path = "../rowan" }

crates/ra_syntax/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212

1313
[dependencies]
1414
itertools = "0.8.0"
15-
rowan = "0.7.0"
15+
rowan = "0.8.0"
1616
rustc_lexer = "0.1.0"
1717
rustc-hash = "1.0.1"
1818
arrayvec = "0.5.1"

crates/ra_syntax/src/algo.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ pub fn insert_children(
140140
});
141141

142142
let new_children = match &position {
143-
InsertPosition::First => to_insert.chain(old_children).collect::<Box<[_]>>(),
144-
InsertPosition::Last => old_children.chain(to_insert).collect::<Box<[_]>>(),
143+
InsertPosition::First => to_insert.chain(old_children).collect::<Vec<_>>(),
144+
InsertPosition::Last => old_children.chain(to_insert).collect::<Vec<_>>(),
145145
InsertPosition::Before(anchor) | InsertPosition::After(anchor) => {
146146
let take_anchor = if let InsertPosition::After(_) = position { 1 } else { 0 };
147147
let split_at = position_of_child(parent, anchor.clone()) + take_anchor;
148148
let before = old_children.by_ref().take(split_at).collect::<Vec<_>>();
149-
before.into_iter().chain(to_insert).chain(old_children).collect::<Box<[_]>>()
149+
before.into_iter().chain(to_insert).chain(old_children).collect::<Vec<_>>()
150150
}
151151
};
152152

@@ -174,7 +174,7 @@ pub fn replace_children(
174174
.into_iter()
175175
.chain(to_insert.map(to_green_element))
176176
.chain(old_children.skip(end + 1 - start))
177-
.collect::<Box<[_]>>();
177+
.collect::<Vec<_>>();
178178
with_children(parent, new_children)
179179
}
180180

@@ -187,7 +187,7 @@ pub fn replace_descendants(
187187
map: &FxHashMap<SyntaxElement, SyntaxElement>,
188188
) -> SyntaxNode {
189189
// FIXME: this could be made much faster.
190-
let new_children = parent.children_with_tokens().map(|it| go(map, it)).collect::<Box<[_]>>();
190+
let new_children = parent.children_with_tokens().map(|it| go(map, it)).collect::<Vec<_>>();
191191
return with_children(parent, new_children);
192192

193193
fn go(
@@ -211,7 +211,7 @@ pub fn replace_descendants(
211211

212212
fn with_children(
213213
parent: &SyntaxNode,
214-
new_children: Box<[NodeOrToken<rowan::GreenNode, rowan::GreenToken>]>,
214+
new_children: Vec<NodeOrToken<rowan::GreenNode, rowan::GreenToken>>,
215215
) -> SyntaxNode {
216216
let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>();
217217
let new_node =

crates/ra_syntax/src/syntax_node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub use rowan::{Direction, NodeOrToken};
4040

4141
pub struct SyntaxTreeBuilder {
4242
errors: Vec<SyntaxError>,
43-
inner: GreenNodeBuilder,
43+
inner: GreenNodeBuilder<'static>,
4444
}
4545

4646
impl Default for SyntaxTreeBuilder {

0 commit comments

Comments
 (0)