2018-02-22 06:09:53 +00:00
|
|
|
// primitive_types6.rs
|
2023-05-29 17:39:08 +00:00
|
|
|
//
|
|
|
|
// Use a tuple index to access the second element of `numbers`. You can put the
|
|
|
|
// expression for the second element where ??? is so that the test passes.
|
|
|
|
//
|
|
|
|
// Execute `rustlings hint primitive_types6` or use the `hint` watch subcommand
|
|
|
|
// for a hint.
|
2016-02-07 17:34:53 +00:00
|
|
|
|
2019-11-11 12:38:24 +00:00
|
|
|
// I AM NOT DONE
|
|
|
|
|
2020-10-10 14:04:19 +00:00
|
|
|
#[test]
|
|
|
|
fn indexing_tuple() {
|
2016-02-07 17:34:53 +00:00
|
|
|
let numbers = (1, 2, 3);
|
2020-10-14 06:20:17 +00:00
|
|
|
// Replace below ??? with the tuple indexing syntax.
|
2020-10-10 14:04:19 +00:00
|
|
|
let second = ???;
|
|
|
|
|
2020-10-14 06:18:41 +00:00
|
|
|
assert_eq!(2, second,
|
2020-10-10 14:04:19 +00:00
|
|
|
"This is not the 2nd number in the tuple!")
|
2016-02-07 17:34:53 +00:00
|
|
|
}
|