weak_table/
util.rs

1use crate::compat::*;
2
3pub fn new_boxed_option_slice<T>(size: usize) -> Box<[Option<T>]> {
4    let mut vector = Vec::with_capacity(size);
5    for _ in 0 .. size {
6        vector.push(None)
7    }
8    vector.into_boxed_slice()
9}