Skip to content

Commit

Permalink
Merge pull request rust-lang#365 from sjmann/generics-2-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoko authored May 19, 2020
2 parents 2895f3f + 5a730d6 commit 169dc7a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions exercises/generics/generics2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Rewrite it using generics so that it supports wrapping ANY type.

// I AM NOT DONE
struct Wrapper<u32> {
struct Wrapper {
value: u32
}

impl<u32> Wrapper<u32> {
impl Wrapper {
pub fn new(value: u32) -> Self {
Wrapper { value }
}
Expand All @@ -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");
}
}

0 comments on commit 169dc7a

Please sign in to comment.