fn take_prefix(blocks: &mut VecDeque<EncodedBlock>, mut max_size: usize) -> Vec<EncodedBlock> {
    let mut result = vec![];
    while let Some(next) = blocks.front() {
        if next.size_bytes() > max_size {
            break;
        }
        max_size -= next.size_bytes();
        result.push(blocks.pop_front().unwrap());
    }
    result
}
/// Extract longest prefix from `blocks` which fits in `max_size`
Extract longest prefix from `blocks` which fits in `max_size`
Extract longest prefix from ` blocks ` which fits in ` max_size `
fn take_prefix(blocks: &mut VecDeque<EncodedBlock>, mut max_size: usize) -> Vec<EncodedBlock> {
    let mut result = vec![];
    while let Some(next) = blocks.front() {
        if next.size_bytes() > max_size {
            break;
        }
        max_size -= next.size_bytes();
        result.push(blocks.pop_front().unwrap());
    }
    result
}
fn take_prefix ( blocks : & mut VecDeque < EncodedBlock > , mut max_size : usize ) -> Vec < EncodedBlock > { let mut result = vec ! [ ] ; while let Some ( next ) = blocks . front ( ) { if next . size_bytes ( ) > max_size { break ; } max_size -= next . size_bytes ( ) ; result . push ( blocks . pop_front ( ) . unwrap ( ) ) ; } result }
Extract longest prefix from `blocks` which fits in `max_size`
Extract longest prefix from ` blocks ` which fits in ` max_size `
blocks
&mut VecDeque<EncodedBlock>
max_size
usize
blocks
&mut VecDeque<EncodedBlock>
max_size
usize