fn print_enumerated<T: fmt::Display>(v: &Vec<T>) {
    for (i, t) in v.iter().enumerate() {
        println!("Position {}: {}", i, t);
    }
}
// Sometimes it is useful to know both the position of some element in a list, and its value. That's where the `enumerate` function helps.
Sometimes it is useful to know both the position of some element in a list, and its value. That's where the `enumerate` function helps.
Sometimes it is useful to know both the position of some element in a list and its value . That ' s where the ` enumerate ` function helps .
fn print_enumerated<T: fmt::Display>(v: &Vec<T>) {
    for (i, t) in v.iter().enumerate() {
        println!("Position {}: {}", i, t);
    }
}
fn print_enumerated < T : fmt :: Display > ( v : & Vec < T > ) { for ( i , t ) in v . iter ( ) . enumerate ( ) { println ! ( " " i t ) ; } }
Sometimes it is useful to know both the position of some element in a list, and its value.
Sometimes it is useful to know both the position of some element in a list and its value .
v
&Vec<T>
v
&Vec<T>