-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 write it were ??? 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 ??? by tuple indexing syntax. | ||
let second = ???; | ||
|
||
assert_eq!(2, second | ||
"This is not the 2nd number of the tuple numbers") | ||
} |