From 6fc66c4ee667da871ea1f0c8b48b5e9b7373a187 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Jul 2018 18:14:14 +0300 Subject: Use boxed sliced for red nodes --- src/yellow/red.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/yellow/red.rs') diff --git a/src/yellow/red.rs b/src/yellow/red.rs index 8907100e4..bffb72510 100644 --- a/src/yellow/red.rs +++ b/src/yellow/red.rs @@ -5,7 +5,7 @@ use {yellow::GreenNode, TextUnit}; pub(crate) struct RedNode { green: GreenNode, parent: Option, - children: RwLock>>, + children: RwLock]>>, } #[derive(Debug)] @@ -36,7 +36,9 @@ impl RedNode { fn new(green: GreenNode, parent: Option) -> RedNode { let n_children = green.children().len(); - let children = (0..n_children).map(|_| None).collect(); + let children = (0..n_children).map(|_| None) + .collect::>() + .into_boxed_slice(); RedNode { green, parent, -- cgit v1.2.3