fn encode_section( output: &mut Vec<u8>, buckets: &[(i64, u64)], descending: bool, ) -> Result<(), String>