main rust-ownership/lessons/03-borrowing-and-references

README.md

Lesson 3: Borrowing and references

This lesson covers borrowing and references. You'll read a short explanation, try three small exercises and finish with a quiz.

Full lesson: https://glibcode.net/courses/rust-ownership/lessons/3

Files

  • src/main.rs: shared and mutable references

Tip: cargo clippy explains a lot of borrow-checker surprises in plain words.

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.