Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(primitive_types6): Add a test #548

Merged
merged 3 commits into from
Oct 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions exercises/primitive_types/primitive_types6.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// primitive_types6.rs
// Use a tuple index to access the second element of `numbers`.
// You can put this right into the `println!` where the ??? is.
// You can put the expression for the second element where ??? is so that the test passes.
// Execute `rustlings hint primitive_types6` for hints!

// I AM NOT DONE

fn main() {
#[test]
fn indexing_tuple() {
let numbers = (1, 2, 3);
println!("The second number is {}", ???);
/// Replace below ??? with the tuple indexing syntax.
let second = ???;

assert_eq!(2, second
"This is not the 2nd number in the tuple!")
}