We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 10967bc + 964c974 commit 5166660Copy full SHA for 5166660
exercises/generics/generics2.rs
@@ -2,11 +2,11 @@
2
// Rewrite it using generics so that it supports wrapping ANY type.
3
4
// I AM NOT DONE
5
-struct Wrapper<u32> {
+struct Wrapper {
6
value: u32
7
}
8
9
-impl<u32> Wrapper<u32> {
+impl Wrapper {
10
pub fn new(value: u32) -> Self {
11
Wrapper { value }
12
@@ -23,8 +23,6 @@ mod tests {
23
24
#[test]
25
fn store_str_in_wrapper() {
26
- // TODO: Delete this assert and uncomment the one below once you have finished the exercise.
27
- assert!(false);
28
- // assert_eq!(Wrapper::new("Foo").value, "Foo");
+ assert_eq!(Wrapper::new("Foo").value, "Foo");
29
30
0 commit comments