aboutsummaryrefslogtreecommitdiff
path: root/src/tree/file_builder.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2017-12-31 17:37:34 +0000
committerAleksey Kladov <[email protected]>2017-12-31 17:37:34 +0000
commitf16fed18b3587637f4e50ac03aecdbc6f0e8d1fa (patch)
treed3aa6b9286055f26b1c331dee6451837c3b823d5 /src/tree/file_builder.rs
parent9e4c28820146ccaf29ecbce9802aeba80183851a (diff)
Wow, it is possible to implement Index for Vec!
Diffstat (limited to 'src/tree/file_builder.rs')
-rw-r--r--src/tree/file_builder.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tree/file_builder.rs b/src/tree/file_builder.rs
index c977b254c..430303ce9 100644
--- a/src/tree/file_builder.rs
+++ b/src/tree/file_builder.rs
@@ -81,7 +81,7 @@ impl FileBuilder {
81 } 81 }
82 82
83 fn add_len(&mut self, child: NodeIdx) { 83 fn add_len(&mut self, child: NodeIdx) {
84 let range = self.nodes[child.0 as usize].range; 84 let range = self.nodes[child].range;
85 grow(&mut self.current_parent().range, range); 85 grow(&mut self.current_parent().range, range);
86 } 86 }
87 87
@@ -90,13 +90,13 @@ impl FileBuilder {
90 } 90 }
91 91
92 fn current_parent(&mut self) -> &mut NodeData { 92 fn current_parent(&mut self) -> &mut NodeData {
93 let NodeIdx(idx) = self.current_id(); 93 let idx = self.current_id();
94 &mut self.nodes[idx as usize] 94 &mut self.nodes[idx]
95 } 95 }
96 96
97 fn current_sibling(&mut self) -> Option<&mut NodeData> { 97 fn current_sibling(&mut self) -> Option<&mut NodeData> {
98 let NodeIdx(idx) = self.in_progress.last().unwrap().1?; 98 let idx = self.in_progress.last().unwrap().1?;
99 Some(&mut self.nodes[idx as usize]) 99 Some(&mut self.nodes[idx])
100 } 100 }
101} 101}
102 102