README.md
Lesson 4: Slices
We look at slices the way working developers use it, with examples you can change and run right away.
Full lesson: https://glibcode.net/courses/rust-ownership/lessons/4
Files
src/main.rs: string and array slices
Tip:
cargo checkis much faster thancargo buildwhile you are still fixing errors.
Tip: Read the whole compiler message: the note at the end usually has the fix.
Tip:
cargo clippyexplains a lot of borrow-checker surprises in plain words.
Run it
cargo run
Exercises
See exercises.md. Ask in the forum once you've tried.