Unwrap an inner node into two slices (keys, trees).
(&self)
| 96 | |
| 97 | /// Unwrap an inner node into two slices (keys, trees). |
| 98 | pub fn unwrap_inner(&self) -> (&[F::Key], &[Node]) { |
| 99 | match *self { |
| 100 | Self::Inner { |
| 101 | size, |
| 102 | ref keys, |
| 103 | ref tree, |
| 104 | } => { |
| 105 | let size = usize::from(size); |
| 106 | // TODO: We could probably use `get_unchecked()` here since `size` is always in |
| 107 | // range. |
| 108 | (&keys[0..size], &tree[0..=size]) |
| 109 | } |
| 110 | _ => panic!("Expected inner node"), |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /// Unwrap a leaf node into two slices (keys, values) of the same length. |
| 115 | pub fn unwrap_leaf(&self) -> (&[F::Key], &[F::Value]) { |
no test coverage detected