fn tree_from_header(header: &[u8]) -> HuffmanTree<Depth> {
    header.iter()
        .enumerate()
        .filter_map(|(byte, &depth)| {
            (depth != 0).then(|| (Depth(depth), byte as u8))
        })
        .collect()
}
/// Returns the canonical tree producing a given header.
Returns the canonical tree producing a given header.
Returns the canonical tree producing a given header .
fn tree_from_header(header: &[u8]) -> HuffmanTree<Depth> {
    header.iter()
        .enumerate()
        .filter_map(|(byte, &depth)| {
            (depth != 0).then(|| (Depth(depth), byte as u8))
        })
        .collect()
}
fn tree_from_header ( header : & [ u8 ] ) -> HuffmanTree < Depth > { header . iter ( ) . enumerate ( ) . filter_map ( | ( byte , & depth ) | { ( depth != 0 ) . then ( | | ( Depth ( depth ) , byte as u8 ) ) } ) . collect ( ) }
Returns the canonical tree producing a given header.
Returns the canonical tree producing a given header .
header
&[u8]
header
&[u8]