Skip to content

Commit

Permalink
feat(primitive_types6): Add a test (#548)
Browse files Browse the repository at this point in the history
Co-authored-by: Annika <56906084+AnnikaCodes@users.noreply.github.com>
Co-authored-by: fmoko <mokou@posteo.de>
  • Loading branch information
3 people authored Oct 10, 2020
1 parent 18e0bfe commit 2b1fb2b
Showing 1 changed file with 8 additions and 3 deletions.
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!")
}

0 comments on commit 2b1fb2b

Please sign in to comment.