aboutsummaryrefslogtreecommitdiff
path: root/src/yellow/red.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-31 13:40:40 +0100
committerAleksey Kladov <[email protected]>2018-07-31 13:40:40 +0100
commit9ce7e8110254e8db476c96bce2eecb2d16983159 (patch)
treeabaddbafc4593948849394b430e3bde5c624fa22 /src/yellow/red.rs
parent2a2815266b35de12bd3c48cc405e8b3e8fcf8885 (diff)
cleanups
Diffstat (limited to 'src/yellow/red.rs')
-rw-r--r--src/yellow/red.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/yellow/red.rs b/src/yellow/red.rs
index a30318c6e..c3d6c5f4f 100644
--- a/src/yellow/red.rs
+++ b/src/yellow/red.rs
@@ -36,7 +36,8 @@ impl RedNode {
36 36
37 fn new(green: GreenNode, parent: Option<ParentData>) -> RedNode { 37 fn new(green: GreenNode, parent: Option<ParentData>) -> RedNode {
38 let n_children = green.children().len(); 38 let n_children = green.children().len();
39 let children = (0..n_children).map(|_| None) 39 let children = (0..n_children)
40 .map(|_| None)
40 .collect::<Vec<_>>() 41 .collect::<Vec<_>>()
41 .into_boxed_slice(); 42 .into_boxed_slice();
42 RedNode { 43 RedNode {
@@ -63,7 +64,7 @@ impl RedNode {
63 64
64 pub(crate) fn get_child(&self, idx: usize) -> Option<ptr::NonNull<RedNode>> { 65 pub(crate) fn get_child(&self, idx: usize) -> Option<ptr::NonNull<RedNode>> {
65 if idx >= self.n_children() { 66 if idx >= self.n_children() {
66 return None 67 return None;
67 } 68 }
68 match &self.children.read().unwrap()[idx] { 69 match &self.children.read().unwrap()[idx] {
69 Some(child) => return Some(child.into()), 70 Some(child) => return Some(child.into()),