/// Split a batch list into multiple batch lists of size 'size_limit'
Split a batch list into multiple batch lists of size 'size_limit'
Split a batch list into multiple batch lists of size ' size_limit '
fn split_batches(batch_list: BatchList, size_limit: usize) -> Vec<BatchList> {
    let mut batch_lists = Vec::new();
    for chunk in batch_list.batches.chunks(size_limit) {
        let mut new_batch_list = BatchList::new();
        new_batch_list.set_batches(protobuf::RepeatedField::from_vec(chunk.to_vec()));
        batch_lists.push(new_batch_list);
    }
    batch_lists
}
fn split_batches ( batch_list : BatchList , size_limit : usize ) -> Vec < BatchList > { let mut batch_lists = Vec :: new ( ) ; for chunk in batch_list . batches . chunks ( size_limit ) { let mut new_batch_list = BatchList :: new ( ) ; new_batch_list . set_batches ( protobuf :: RepeatedField :: from_vec ( chunk . to_vec ( ) ) ) ; batch_lists . push ( new_batch_list ) ; } batch_lists }
Split a batch list into multiple batch lists of size 'size_limit'
Split a batch list into multiple batch lists of size ' size_limit '
batch_list
BatchList
size_limit
usize