summaryrefslogtreecommitdiff
path: root/exercises
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-06-19 14:25:29 +0200
committermo8it <mo8it@proton.me>2024-06-19 14:25:29 +0200
commit0abcdeed42957ca805a3a7475fb3f14085af346e (patch)
treead41929b904983d40d9027c98577be51b6b87e16 /exercises
parent532c9ebb30afa226590e68e87af11da42b598974 (diff)
primitive_types6 solution
Diffstat (limited to 'exercises')
-rw-r--r--exercises/04_primitive_types/primitive_types6.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/exercises/04_primitive_types/primitive_types6.rs b/exercises/04_primitive_types/primitive_types6.rs
index 83cec24..a97e531 100644
--- a/exercises/04_primitive_types/primitive_types6.rs
+++ b/exercises/04_primitive_types/primitive_types6.rs
@@ -1,21 +1,17 @@
-// Use a tuple index to access the second element of `numbers`. You can put the
-// expression for the second element where ??? is so that the test passes.
-
fn main() {
// You can optionally experiment here.
}
#[cfg(test)]
mod tests {
- use super::*;
-
#[test]
fn indexing_tuple() {
let numbers = (1, 2, 3);
- // Replace below ??? with the tuple indexing syntax.
- let second = ???;
- assert_eq!(2, second,
- "This is not the 2nd number in the tuple!")
+ // TODO: Use a tuple index to access the second element of `numbers`
+ // and assign it to a variable called `second`.
+ // let second = ???;
+
+ assert_eq!(second, 2, "This is not the 2nd number in the tuple!");
}
}