1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{fragment::fragment_struct::Fragment, SplitVec, SplitVecGrowth};

impl<T, G> Default for SplitVec<T, G>
where
    G: SplitVecGrowth<T> + Default,
{
    /// Creates an empty split vector with the default `FragmentGrowth` strategy.
    fn default() -> Self {
        let growth = G::default();
        let capacity = SplitVecGrowth::<T>::new_fragment_capacity(&growth, &[]);
        let fragment = Fragment::new(capacity);
        let fragments = vec![fragment];
        Self { fragments, growth }
    }
}