pub fn positions<T: Eq>(list: &[T], item: T) -> Vec<i32> {
    let mut collector: Vec<i32> = vec![];

    for counter in 0 .. list.len() {
        if list[counter] == item {
            collector.push(counter.clone() as i32);
        }
    }

    return collector;
}
/// Locate the indices of occurences of an element in a given list.
/// # Examples
/// ```
/// let spots_of_a = positions(&['a', 'a', 'b', 'a'], 'a')
///```
Locate the indices of occurences of an element in a given list.
Locate the indices of occurences of an element in a given list .
pub fn positions<T: Eq>(list: &[T], item: T) -> Vec<i32> {
    let mut collector: Vec<i32> = vec![];
    for counter in 0 .. list.len() {
        if list[counter] == item {
            collector.push(counter.clone() as i32);
        }
    }
    return collector;
}
pub fn positions < T : Eq > ( list : & [ T ] , item : T ) -> Vec < i32 > { let mut collector : Vec < i32 > = vec ! [ ] ; for counter in 0 .. list . len ( ) { if list [ counter ] == item { collector . push ( counter . clone ( ) as i32 ) ; } } return collector ; }
Locate the indices of occurences of an element in a given list.
Locate the indices of occurences of an element in a given list .
list
&[T]
item
T