Skip to content

Commit 2b1fb2b

Browse files
darnuriaAnnikaCodesfmoko
authored
feat(primitive_types6): Add a test (#548)
Co-authored-by: Annika <56906084+AnnikaCodes@users.noreply.github.com> Co-authored-by: fmoko <mokou@posteo.de>
1 parent 18e0bfe commit 2b1fb2b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
// primitive_types6.rs
22
// Use a tuple index to access the second element of `numbers`.
3-
// You can put this right into the `println!` where the ??? is.
3+
// You can put the expression for the second element where ??? is so that the test passes.
44
// Execute `rustlings hint primitive_types6` for hints!
55

66
// I AM NOT DONE
77

8-
fn main() {
8+
#[test]
9+
fn indexing_tuple() {
910
let numbers = (1, 2, 3);
10-
println!("The second number is {}", ???);
11+
/// Replace below ??? with the tuple indexing syntax.
12+
let second = ???;
13+
14+
assert_eq!(2, second
15+
"This is not the 2nd number in the tuple!")
1116
}

0 commit comments

Comments
 (0)