fn keep_index_matches(rules: &Vec<IndexFilter>, data: Vec<Vec<u8>>) -> Vec<Vec<u8>> {
    let mut result = vec![];

    for i in 0..data.len() {
        if rules.iter().any(|rule| rule.is_match(i)) {
            result.push(data[i].clone());
        }
    }

    result
}
/// Parse the rules for indexes, then keep only entries in the data that match the rules given for indexes.
///
/// This function is a bit atypical in that the rules_str argument is expected to be user input, and has purposefully relaxed parsing logic.
/// It also returns data even in the error case, so that the user still gets some feedback even with invalid input.
/// This is **not** a goal of the rest of the code, in general failing fast is preferred unless there is a strong tie to user input.
Parse the rules for indexes, then keep only entries in the data that match the rules given for indexes.
This function is a bit atypical in that the rules_str argument is expected to be user input, and has purposefully relaxed parsing logic.
It also returns data even in the error case, so that the user still gets some feedback even with invalid input.
This is **not** a goal of the rest of the code, in general failing fast is preferred unless there is a strong tie to user input.
Parse the rules for indexes then keep only entries in the data that match the rules given for indexes . This function is a bit atypical in that the rules_str argument is expected to be user input and has purposefully relaxed parsing logic . It also returns data even in the error case so that the user still gets some feedback even with invalid input . This is ** not ** a goal of the rest of the code in general failing fast is preferred unless there is a strong tie to user input .
fn keep_index_matches(rules: &Vec<IndexFilter>, data: Vec<Vec<u8>>) -> Vec<Vec<u8>> {
    let mut result = vec![];
    for i in 0..data.len() {
        if rules.iter().any(|rule| rule.is_match(i)) {
            result.push(data[i].clone());
        }
    }
    result
}
fn keep_index_matches ( rules : & Vec < IndexFilter > , data : Vec < Vec < u8 > > ) -> Vec < Vec < u8 > > { let mut result = vec ! [ ] ; for i in 0 .. data . len ( ) { if rules . iter ( ) . any ( | rule | rule . is_match ( i ) ) { result . push ( data [ i ] . clone ( ) ) ; } } result }
Parse the rules for indexes, then keep only entries in the data that match the rules given for indexes.
Parse the rules for indexes then keep only entries in the data that match the rules given for indexes .
rules
&Vec<IndexFilter>
data
Vec<Vec<u8>>