From 884a0b6a5162d1e58b445a225099b02ee75e7fdc Mon Sep 17 00:00:00 2001 From: Chris Girvin Date: Mon, 16 May 2022 19:22:02 -0400 Subject: [PATCH] primitive_types done --- exercises/primitive_types/primitive_types5.rs | 4 +--- exercises/primitive_types/primitive_types6.rs | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/exercises/primitive_types/primitive_types5.rs b/exercises/primitive_types/primitive_types5.rs index 680d8d23..5028c0cd 100644 --- a/exercises/primitive_types/primitive_types5.rs +++ b/exercises/primitive_types/primitive_types5.rs @@ -2,11 +2,9 @@ // Destructure the `cat` tuple so that the println will work. // Execute `rustlings hint primitive_types5` for hints! -// I AM NOT DONE - fn main() { let cat = ("Furry McFurson", 3.5); - let /* your pattern here */ = cat; + let (name, age)/* your pattern here */ = cat; println!("{} is {} years old.", name, age); } diff --git a/exercises/primitive_types/primitive_types6.rs b/exercises/primitive_types/primitive_types6.rs index b8c9b82b..a0c455af 100644 --- a/exercises/primitive_types/primitive_types6.rs +++ b/exercises/primitive_types/primitive_types6.rs @@ -3,14 +3,12 @@ // 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 - #[test] fn indexing_tuple() { let numbers = (1, 2, 3); // Replace below ??? with the tuple indexing syntax. - let second = ???; + // let second = ???; + let second = numbers.1; - assert_eq!(2, second, - "This is not the 2nd number in the tuple!") + assert_eq!(2, second, "This is not the 2nd number in the tuple!") }