fn split(separators: &ByteTrie, data: &Vec<u8>) -> Vec<Vec<u8>> {
    let mut result = vec![];
    let mut current_line = vec![];
    let mut current_separator = vec![];

    for byte in data {
        current_separator.push(*byte);
        match separators.membership(current_separator.as_slice()) {
            Membership::NotIncluded => {
                current_line.push(*byte);
                if !current_separator.is_empty() {
                    current_separator = vec![];
                }
            }
            Membership::Included if !current_line.is_empty() => {
                result.push(current_line);
                current_line = vec![];
            }
            Membership::Included => (),
            Membership::IncludedAndTerminal if !current_line.is_empty() => {
                result.push(current_line);
                current_line = vec![];
                current_separator = vec![];
            }
            Membership::IncludedAndTerminal => {
                current_separator = vec![];
            }
        };
    }

    if !current_line.is_empty() {
        result.push(current_line);
    }

    result
}
/// Splits string data into parts according to the given separators.
Splits string data into parts according to the given separators.
Splits string data into parts according to the given separators .
fn split(separators: &ByteTrie, data: &Vec<u8>) -> Vec<Vec<u8>> {
    let mut result = vec![];
    let mut current_line = vec![];
    let mut current_separator = vec![];
    for byte in data {
        current_separator.push(*byte);
        match separators.membership(current_separator.as_slice()) {
            Membership::NotIncluded => {
                current_line.push(*byte);
                if !current_separator.is_empty() {
                    current_separator = vec![];
                }
            }
            Membership::Included if !current_line.is_empty() => {
                result.push(current_line);
                current_line = vec![];
            }
            Membership::Included => (),
            Membership::IncludedAndTerminal if !current_line.is_empty() => {
                result.push(current_line);
                current_line = vec![];
                current_separator = vec![];
            }
            Membership::IncludedAndTerminal => {
                current_separator = vec![];
            }
        };
    }
    if !current_line.is_empty() {
        result.push(current_line);
    }
    result
}
fn split ( separators : & ByteTrie , data : & Vec < u8 > ) -> Vec < Vec < u8 > > { let mut result = vec ! [ ] ; let mut current_line = vec ! [ ] ; let mut current_separator = vec ! [ ] ; for byte in data { current_separator . push ( * byte ) ; match separators . membership ( current_separator . as_slice ( ) ) { Membership :: NotIncluded => { current_line . push ( * byte ) ; if ! current_separator . is_empty ( ) { current_separator = vec ! [ ] ; } } Membership :: Included if ! current_line . is_empty ( ) => { result . push ( current_line ) ; current_line = vec ! [ ] ; } Membership :: Included => ( ) , Membership :: IncludedAndTerminal if ! current_line . is_empty ( ) => { result . push ( current_line ) ; current_line = vec ! [ ] ; current_separator = vec ! [ ] ; } Membership :: IncludedAndTerminal => { current_separator = vec ! [ ] ; } } ; } if ! current_line . is_empty ( ) { result . push ( current_line ) ; } result }
Splits string data into parts according to the given separators.
Splits string data into parts according to the given separators .
separators
&ByteTrie
data
&Vec<u8>