aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/libsyntax2/src/yellow/red.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/libsyntax2/src/yellow/red.rs b/crates/libsyntax2/src/yellow/red.rs
index 1ee6bdf18..84cfe4fba 100644
--- a/crates/libsyntax2/src/yellow/red.rs
+++ b/crates/libsyntax2/src/yellow/red.rs
@@ -56,13 +56,13 @@ impl RedNode {
56 } 56 }
57 57
58 fn new(green: GreenNode, parent: Option<ParentData>) -> RedNode { 58 fn new(green: GreenNode, parent: Option<ParentData>) -> RedNode {
59 let start_offset = parent.as_ref().map(|it| it.start_offset).unwrap_or(0.into()); 59 let mut start_offset = parent.as_ref().map(|it| it.start_offset).unwrap_or(0.into());
60 let children = green.children() 60 let children = green.children()
61 .iter() 61 .iter()
62 .scan(start_offset, |start_offset, child| { 62 .map(|child| {
63 let res = RedChild::Zigot(*start_offset); 63 let off = start_offset;
64 *start_offset += child.text_len(); 64 start_offset += child.text_len();
65 Some(res) 65 RedChild::Zigot(off)
66 }) 66 })
67 .collect::<Vec<_>>() 67 .collect::<Vec<_>>()
68 .into_boxed_slice(); 68 .into_boxed_slice();