pub fn filter_break<T: Clone, F>(list: &[T], pred: F) -> Vec<T> 
    where F: Fn(&T) -> bool {
    let mut collector: Vec<T> = vec![];

    for item in list {
        if ! pred(item) {
            return collector.clone();
        }
        collector.push(item.clone());
    }
        return collector.clone();
}
/// Filters a list, ceasing to collect once a predicate returns FALSE.
/// # Examples
/// ```
/// use citadel::prelude;
/// let one_two_three = prelude::filter_break(&[1, 2, 3, 4], |x: &usize| -> bool {*x != 4});
/// ```
Filters a list, ceasing to collect once a predicate returns FALSE.
Filters a list ceasing to collect once a predicate returns FALSE .
pub fn filter_break<T: Clone, F>(list: &[T], pred: F) -> Vec<T> 
    where F: Fn(&T) -> bool {
    let mut collector: Vec<T> = vec![];
    for item in list {
        if ! pred(item) {
            return collector.clone();
        }
        collector.push(item.clone());
    }
        return collector.clone();
}
pub fn filter_break < T : Clone , F > ( list : & [ T ] , pred : F ) -> Vec < T > where F : Fn ( & T ) -> bool { let mut collector : Vec < T > = vec ! [ ] ; for item in list { if ! pred ( item ) { return collector . clone ( ) ; } collector . push ( item . clone ( ) ) ; } return collector . clone ( ) ; }
Filters a list, ceasing to collect once a predicate returns FALSE.
Filters a list ceasing to collect once a predicate returns FALSE .
list
&[T]
pred
F
examples
None