Function compile_write_tree
fn compile_write_tree<E, T>(values: Vec<(T, Vec<u8>)>) -> Result<WriteHuffmanTree<E, T>, HuffmanTreeError>
where
E: Endianness,
T: Ord + Clone
Given a vector of symbol/code pairs, compiles a Huffman tree for writing.
Code must be 0 or 1 bits and are always written to the stream from least-significant in the list to most signficant (which makes them easier to read for humans).
If the same symbol occurs multiple times, the first code is used. Unlike in read trees, not all possible codes need to be assigned a symbol.
Examples
use compile_write_tree;
use BigEndian;
assert!;
use Write;
use ;
use compile_write_tree;
let tree = compile_write_tree.unwrap;
let mut data = Vecnew;
assert_eq!;