Here is a practical, hands-on **7-Day Rust Intensive Learning Plan** designed to move you from reading simple code to confidently writing real Rust programs.

Your system already has **`rustc 1.97.1`** and **`cargo`** installed, so you can start writing and running code immediately with `cargo new project_name`.

---

### 🗓️ Day 1: Ownership, Borrowing & Slices (The Foundation)
* **Goal**: Master Rust's core memory rules so compiler errors become clear guidance rather than frustations.
* **Key Topics**:
  - Ownership rules (1 owner, dropped when out of scope).
  - Borrowing: Shared references (`&T`) vs. Mutable references (`&mut T`).
  - *The Golden Rule*: Unlimited read references **OR** exactly one mutable reference at a time.
  - Slices (`&str`, `&[T]`) vs owned types (`String`, `Vec<T>`).
* **Practical Exercise**:
  - Write a function `first_word(s: &str) -> &str` that returns a slice of the first word without copying memory.

---

### 🗓️ Day 2: Enums, `Option`, `Result` & Pattern Matching
* **Goal**: Understand Rust's approach to error handling and data modeling (replacing `null` and exceptions).
* **Key Topics**:
  - Custom `enum` with data variants.
  - Pattern matching: `match` and `if let`.
  - `Option<T>` (`Some` vs `None`).
  - `Result<T, E>` (`Ok` vs `Err`) and the **`?` operator** for clean error propagation.
* **Practical Exercise**:
  - Build a mini calculator function `evaluate(expr: &str) -> Result<f64, String>` that safely handles division by zero and bad inputs without crashing.

---

### 🗓️ Day 3: Structs, Methods & Traits
* **Goal**: Learn Rust's version of Object-Oriented polymorphism.
* **Key Topics**:
  - Defining `struct` and `impl` blocks (`self`, `&self`, `&mut self`).
  - Standard traits: `Display`, `Debug`, `Clone`, `From` / `Into`.
  - Defining custom `trait`s and writing generic functions with trait bounds (`fn print_it<T: Display>(item: T)`).
  - Automatic `#[derive(Debug, Clone, PartialEq)]`.
* **Practical Exercise**:
  - Create a `Shape` trait with `.area()` and `.perimeter()` methods, and implement it for `Circle` and `Rectangle` structs.

---

### 🗓️ Day 4: Collections, Iterators & Functional Rust
* **Goal**: Write idiomatic, zero-cost, high-performance loops.
* **Key Topics**:
  - `Vec<T>`, `HashMap<K, V>`, and `HashSet<T>`.
  - Iterators: `.iter()`, `.iter_mut()`, `.into_iter()`.
  - Functional combinators: `.map()`, `.filter()`, `.fold()`, `.collect()`.
* **Practical Exercise**:
  - Write a program that reads a list of numbers, filters out odd numbers, doubles even numbers, and collects them into a `HashMap` mapping input index to result.

---

### 🗓️ Day 5: Modules, Cargo & Robust Error Handling
* **Goal**: Organize code cleanly into modules and handle production errors cleanly.
* **Key Topics**:
  - Module system: `mod`, `use`, `pub`, `pub(crate)`.
  - File layout: `main.rs`, `lib.rs`, submodules in `src/`.
  - Production error crates: `anyhow` (for application errors) and `thiserror` (for domain libraries).
* **Practical Exercise**:
  - Split a project into separate `src/parser.rs` and `src/evaluator.rs` modules, using `anyhow::Result` for clean CLI output.

---

### 🗓️ Day 6: Smart Pointers & Concurrency Basics
* **Goal**: Understand heap allocations and safe multithreading.
* **Key Topics**:
  - Smart Pointers: `Box<T>` (heap allocation), `Rc<T>` / `Arc<T>` (shared ownership).
  - Interior Mutability: `RefCell<T>` vs `Mutex<T>`.
  - Concurrency: Spawning threads (`std::thread::spawn`), `move` closures, and channels (`std::sync::mpsc`).
* **Practical Exercise**:
  - Spawn 4 worker threads to calculate the sum of large array chunks concurrently and send results back to the main thread via an `mpsc` channel.

---

### 🗓️ Day 7: Capstone Mini-Project (CLI Tool)
* **Goal**: Build a complete, working Rust CLI tool from scratch.
* **Project**: A **Fast Markdown Word & Heading Counter** (or mini `grep` searcher).
* **Requirements**:
  1. Accept a file path from command line arguments (`std::env::args`).
  2. Parse the Markdown file line by line using iterators.
  3. Print count of headings (`#`), code blocks (` ``` `), and total word count.
  4. Return friendly error messages if the file doesn't exist.

---

### 💡 Daily Workflow Tip
Whenever you encounter compiler errors:
```bash
cargo check
```
Read Rust compiler error messages closely — Rust's error messages are often exact instructions on how to fix borrowing and lifetime issues!
