Mo :ferris: :tux: @ FOSDEM on Nostr: I had so much fun with #Rust traits in the last two days 😍 1. Write working code ...
I had so much fun with #Rust traits in the last two days 😍
1. Write working code with a concrete type.
2. Abstract that code using traits and generics.
3. Implement that traits for new types.
4. Profit and enjoy the "magic"
I also worked with the Serialize trait from serde for the first time. Manually implementing it for your custom types can make your code much more efficient!
We talk about more than 2x speedup! I might write about it tomorrow.
#RustLang
1. Write working code with a concrete type.
2. Abstract that code using traits and generics.
3. Implement that traits for new types.
4. Profit and enjoy the "magic"

I also worked with the Serialize trait from serde for the first time. Manually implementing it for your custom types can make your code much more efficient!
We talk about more than 2x speedup! I might write about it tomorrow.
#RustLang