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
use super::*; 

impl <F, S> BiVec<F, S> {
    pub fn leak(self) -> (&'static mut [F], &'static mut [S]) { 
        let first = unsafe { std::slice::from_raw_parts_mut(self.first.as_ptr(), self.len) }; 
        let second = unsafe { std::slice::from_raw_parts_mut(self.second.as_ptr(), self.len) }; 
        core::mem::forget(self);
        (first, second)
    } 
}