diff options
Diffstat (limited to 'src/yellow/red.rs')
-rw-r--r-- | src/yellow/red.rs | 5 |
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()), |