pub fn new_resized(
        drives: &Arc<Vec<PathBuf>>,
        max_search: MaxSearch,
        bucket: Option<&Self>,
        capacity_pow_2: u8,
        num_elems: u64,
        elem_size: u64,
        stats: &Arc<BucketStats>,
    ) -> Self {
        let mut new_bucket = Self::new_with_capacity(
            Arc::clone(drives),
            num_elems,
            elem_size,
            capacity_pow_2,
            max_search,
            Arc::clone(stats),
            bucket
                .map(|bucket| Arc::clone(&bucket.count))
                .unwrap_or_default(),
        );
        if let Some(bucket) = bucket {
            new_bucket.copy_contents(bucket);
        }
        let sz = new_bucket.capacity();
        {
            let mut max = new_bucket.stats.max_size.lock().unwrap();
            *max = std::cmp::max(*max, sz);
        }
        new_bucket
    }
/// allocate a new bucket, copying data from 'bucket'
allocate a new bucket, copying data from 'bucket'
allocate a new bucket copying data from ' bucket '
pub fn new_resized(
        drives: &Arc<Vec<PathBuf>>,
        max_search: MaxSearch,
        bucket: Option<&Self>,
        capacity_pow_2: u8,
        num_elems: u64,
        elem_size: u64,
        stats: &Arc<BucketStats>,
    ) -> Self {
        let mut new_bucket = Self::new_with_capacity(
            Arc::clone(drives),
            num_elems,
            elem_size,
            capacity_pow_2,
            max_search,
            Arc::clone(stats),
            bucket
                .map(|bucket| Arc::clone(&bucket.count))
                .unwrap_or_default(),
        );
        if let Some(bucket) = bucket {
            new_bucket.copy_contents(bucket);
        }
        let sz = new_bucket.capacity();
        {
            let mut max = new_bucket.stats.max_size.lock().unwrap();
            *max = std::cmp::max(*max, sz);
        }
        new_bucket
    }
pub fn new_resized ( drives : & Arc < Vec < PathBuf > > , max_search : MaxSearch , bucket : Option < & Self > , capacity_pow_2 : u8 , num_elems : u64 , elem_size : u64 , stats : & Arc < BucketStats > , ) -> Self { let mut new_bucket = Self :: new_with_capacity ( Arc :: clone ( drives ) , num_elems , elem_size , capacity_pow_2 , max_search , Arc :: clone ( stats ) , bucket . map ( | bucket | Arc :: clone ( & bucket . count ) ) . unwrap_or_default ( ) , ) ; if let Some ( bucket ) = bucket { new_bucket . copy_contents ( bucket ) ; } let sz = new_bucket . capacity ( ) ; { let mut max = new_bucket . stats . max_size . lock ( ) . unwrap ( ) ; * max = std :: cmp :: max ( * max , sz ) ; } new_bucket }
allocate a new bucket, copying data from 'bucket'
allocate a new bucket copying data from ' bucket '
drives
&Arc<Vec<PathBuf>>
max_search
MaxSearch
bucket
Option<&Self>
capacity_pow_2
u8
num_elems
u64
elem_size
u64
stats
&Arc<BucketStats>