<commit_before>use serialization::Serializable;
use abomonation::{Abomonation, encode, decode};
// use columnar::Columnar;

impl<T: Abomonation+Clone> Serializable for T {
    fn encode(typed: Self, bytes: &mut Vec<u8>) {
        encode(&vec![typed], bytes);
    }
    fn decode(bytes: &mut [u8]) -> Result<Self, &mut [u8]> {
        let result = if let Ok(result) = decode::<T>(bytes) { Ok(result[0].clone()) } else { Err(()) };
        if let Ok(result) = result { Ok(result) } else { Err (bytes) }
    }
}<commit_msg>updated for new abomonation interface<commit_after>use serialization::Serializable;
use abomonation::{Abomonation, encode, decode};
// use columnar::Columnar;

impl<T: Abomonation+Clone> Serializable for T {
    fn encode(typed: Self, bytes: &mut Vec<u8>) {
        encode(&typed, bytes);
    }
    fn decode(bytes: &mut [u8]) -> Result<Self, &mut [u8]> {
        let result = if let Ok(result) = decode::<T>(bytes) { Ok(result.clone()) } else { Err(()) };
        if let Ok(result) = result { Ok(result) } else { Err (bytes) }
    }
}
{'fraction_non_alphanumeric': 0.17535545023696683, 'fraction_numerical': 0.006635071090047393, 'mean_word_length': 3.7782805429864252, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2209664', 'n_tokens_mistral': 357, 'n_tokens_neox': 359, 'n_words': 94}