From 964c974a0274199d755073b917c2bc5da0c9b4f1 Mon Sep 17 00:00:00 2001 From: sjmann Date: Tue, 21 Apr 2020 13:34:25 +0100 Subject: [PATCH] fix: update generics2 closes #362 --- exercises/generics/generics2.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/generics/generics2.rs b/exercises/generics/generics2.rs index 1fe5041..23025aa 100644 --- a/exercises/generics/generics2.rs +++ b/exercises/generics/generics2.rs @@ -2,11 +2,11 @@ // Rewrite it using generics so that it supports wrapping ANY type. // I AM NOT DONE -struct Wrapper { +struct Wrapper { value: u32 } -impl Wrapper { +impl Wrapper { pub fn new(value: u32) -> Self { Wrapper { value } } @@ -23,8 +23,6 @@ mod tests { #[test] fn store_str_in_wrapper() { - // TODO: Delete this assert and uncomment the one below once you have finished the exercise. - assert!(false); - // assert_eq!(Wrapper::new("Foo").value, "Foo"); + assert_eq!(Wrapper::new("Foo").value, "Foo"); } } \ No newline at end of file