From c46a7115265406330dc95fc7ab8e500cd8d24859 Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 15 Mar 2024 13:48:57 +0100 Subject: [PATCH] fix: revert from_into test change --- exercises/23_conversions/from_into.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/23_conversions/from_into.rs b/exercises/23_conversions/from_into.rs index 60911f3..da1a9a5 100644 --- a/exercises/23_conversions/from_into.rs +++ b/exercises/23_conversions/from_into.rs @@ -43,8 +43,7 @@ impl Default for Person { // I AM NOT DONE impl From<&str> for Person { - fn from(s: &str) -> Person { - } + fn from(s: &str) -> Person {} } fn main() { @@ -127,14 +126,14 @@ mod tests { #[test] fn test_trailing_comma() { let p: Person = Person::from("Mike,32,"); - assert_eq!(p.name, "Mike"); - assert_eq!(p.age, 32); + assert_eq!(p.name, "John"); + assert_eq!(p.age, 30); } #[test] fn test_trailing_comma_and_some_string() { - let p: Person = Person::from("Mike,32,man"); - assert_eq!(p.name, "Mike"); - assert_eq!(p.age, 32); + let p: Person = Person::from("Mike,32,dog"); + assert_eq!(p.name, "John"); + assert_eq!(p.age, 30); } }