main rust-ownership/lessons/09-traits-and-generics

README.md

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 check is much faster than cargo build while you are still fixing errors.

Run it

cargo run

Exercises

See exercises.md. Ask in the forum once you've tried.