This repository contains my solutions to the Rustlings exercises. Rustlings is an excellent collection of exercises designed to help you learn Rust by solving small coding problems.
The purpose of this repository is to document my progress as I work through the Rustlings exercises. Each section contains different exercises that help to understand and practice various concepts in Rust.
So far, I have solved the following sections:
-
Variables
- Understanding variable declaration, type annotations, mutable variables, shadowing, and constants.
-
Functions
- Learning function definitions, parameters, return types, and how to use expressions and statements.
-
If
- Exploring
if
statements, the most basic form of control flow in Rust. - Control Flow - if expressions
- Exploring
-
Primitive Types
- Delving into Rust's basic types that are essential for effective programming.
- Data Types
- The Slice Type
-
Vectors
- Understanding Vectors, dynamic arrays that can grow and shrink at runtime.
- Storing Lists of Values with Vectors
iter_mut
map
-
Move Semantics
- Learning about ownership, references, and borrowing which are foundational to Rust's memory safety guarantees.
- Ownership
- Reference and borrowing
-
Structs
-
Clone this repository:
git clone https://github.com/Nelly-Njeri/RustlingSolutions.git
cd Rustlings-Solutions
-
Navigate to the topic folder you are interested in:
cd variables
-
Open and review the exercise solutions
to compare with your own solutions or to seek guidance.
For the full list of exercises and setup instructions, visit the Rustlings GitHub repository.
By following along with these solutions, you can see how I approached each exercise and understand the concepts in Rust more deeply. Happy coding! 🚀