5 months ago
21 lines551 B
Lesson 9: Traits and generics
Traits and generics comes up in almost every real Rust project. We start with the why, then write code together.
Full lesson: https://glibcode.net/courses/rust-ownership/lessons/9
Files
src/main.rs: a trait, an impl and a generic function
Tip:
cargo checkis much faster thancargo buildwhile you are still fixing errors.
Run it
cargo run
Exercises
See exercises.md. Ask in the forum once you've tried.