primitive_types6.rs (404B)
1 fn main() { 2 // You can optionally experiment here. 3 } 4 5 #[cfg(test)] 6 mod tests { 7 #[test] 8 fn indexing_tuple() { 9 let numbers = (1, 2, 3); 10 11 // TODO: Use a tuple index to access the second element of `numbers` 12 // and assign it to a variable called `second`. 13 let second = numbers.1; 14 15 assert_eq!(second, 2, "This is not the 2nd number in the tuple!"); 16 } 17 }