Rust for a C programmer
Teach Me Rust
Build fluency in Rust and Cargo through short lessons and programs you write yourself.
Current progress: both exercises in lesson 3 and their ownership explanations are complete.
Available lessons
-
Follow a String through a call
Track ownership and cleanup, then use Cargo to check what happens after a move. -
Borrow a string for a call
Keep ownership with the caller while helpers borrow text and return borrowed views. -
Format text and numbers
Print an aligned report and return a formatted String that owns its text.
References
- Rust first steps
- Cargo commands, basic syntax, ownership and borrowing terms, string and byte types.
- Formatting
- Placeholders, alignment, precision, output macros, and formatting for debugging.
Course roadmap
The next planned lesson is mutable borrowing with &mut, followed by a dedicated
lesson on lifetimes.
Later planned topics:
- Expressions, control flow, structs, enums, pattern matching, and error handling in small programs.
- Modules, dependencies, documentation, formatting tools, and tests through Cargo.
- Traits, generics, collections, and iterators, with later practice on closures and the
Fntraits, attributes, and operator overloading. - Raw pointers,
unsafeRust, and C interoperability after references, lifetimes, and slices are familiar.