Parameterized Fruit
We'll cover the following...
We'll cover the following...
I said we were allowed to write a trait implementation for types we created ourselves. Let’s write a Fruit struct and provide it a Double implementation:
Look at that, we were even able to reuse our double trait method inside the implementation of double for Fruit. How convenient! But after we learned about parameterized structs, it feels a bit limiting to tie ourselves down to an i32. Can we parameterize Fruit? Let’s try it. ...