Merge pull request #365 from sjmann/generics-2-fix

This commit is contained in:
fmoko 2020-05-19 17:49:55 +02:00 committed by GitHub
commit 51666609f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -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 }
}
@ -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");
}
}