bivec 0.1.0

A Rust implementation of Bivec, two vecs in one, with the same length.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::mem::forget;

use super::*; 

impl <F, S> BiVec<F, S> {
    pub fn into_boxed_slice(mut self) -> (Box<[F]>, Box<[S]>) {
        self.trim(); 
        let (first, second) = self.as_slice_mut(); 
        let first = unsafe { Box::from_raw(first) }; 
        let second = unsafe { Box::from_raw(second) }; 
        forget(self);  
        (first, second)
    }
}