Following the Rust Programming Language Book to learn Rust and systems programming. Contains exercises and projects organized by chapter.
| Chapter | Topic | Contents |
|---|---|---|
| 1 | Getting Started | Hello World, Hello Cargo |
| 2 | Guessing Game | Number guessing game with random number generation |
| 3 | Common Concepts | Variables, data types, functions, control flow, loops; practice projects (temperature converter, Fibonacci, 12 Days of Christmas) |
| 4 | Ownership | Ownership rules, references and borrowing |
| 5 | Structs | Defining and using structs, struct methods |
| 6 | Enums | Enums, match control flow, concise control flow (if let) |
| 7 | Crates | Module system, separating modules into files |
| 8 | Collections | Vectors, strings, hash maps; practice projects (median/mode, pig latin, employee directory) |
| 9 | Error Handling | Panic vs Result, error propagation |
| 10 | Generics | Generic types, traits, lifetimes |
| 11 | Testing | Unit tests, integration tests, test organization |
| 12 | Minigrep | CLI grep clone - searches files for text with optional case-insensitive flag |
| 13 | Iterators & Closures | Closure syntax, iterator adaptors, owning iterators |
| 14 | Workspace | Multi-crate workspace with adder/add_one/add_two |
| 15 | Smart Pointers | Box, Deref/Drop traits, Rc, RefCell, reference cycles |
| 16 | Concurrency | Threads, message passing (channels), shared state (Mutex), Sync/Send traits |
| 17 | Async | Async/await syntax and concurrency |
Generates a random number between 1-100 and the player guesses until correct.
A command-line tool that searches for a query string in a file:
cargo run -- query poem.txt
cargo run -- -i query poem.txt
Navigate to any project directory and run:
cargo run
For tests:
cargo test