Skip to content

Commit e77c529

Browse files
darnuriaAnnikaCodesfmoko
authored andcommitted
feat(primitive_types6): Add a test (rust-lang#548)
Co-authored-by: Annika <[email protected]> Co-authored-by: fmoko <[email protected]>
1 parent 87625ed commit e77c529

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
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)