fnabinash / rust-practice

Collection of 240+ Exercises to learn and practice building CLI tools in Rust
MIT License
151 stars 21 forks source link
beginner cli cli-app clitools exercises programming rust rust-lang

rust-practice-map

Rust Practice

This repository tracks my progress of learning Rust, focusing on building production-grade CLI tools.

The exercises are structured to cover all essential Rust concepts, from basics like variables and control flow to advanced topics like asynchronous programming and unsafe Rust and contain tiny projects that teach how to build efficient and scalable production-ready CLI apps.

This repo contains 240+ exercises.

Table of Contents

  1. Folder Structure
  2. Exercises

    Basic Rust
    1. hello world
    2. variables and mutability
    3. data types
    4. control flow
    5. functions
    6. Ownership and borrowing
    Intermediate Rust
    1. structs
    2. enums
    3. collections
    4. error handling
    5. traits
    6. iterators and closures
    7. modules and crates
    Advanced Rust
    1. concurrency
    2. smart pointers
    3. asynchronous programming
    4. macros
    5. unsafe rust
    6. lifetimes and generics
    Projects
    1. command line tool
    2. advanced CLI projects
    3. package building
    4. cross-platform development
    5. integrations, plugins and systems
  3. Contributing
  4. License
  5. Acknowledgement

Folder Structure

This repo is divided into 3 types of folders.

  1. Levels
    • Level indicates the difficulty of exercises.
    • e.g. Basic, Intermediate, Advanced, Projects
  2. Topics
    • Each level contains multiple topics.
    • Each topic is a cargo workspace.
    • e.g. variables, functions, enums, traits ...
  3. Exercises
    • Each topic contains 10 exercises.
    • Each exercise is a member of that workspace.
    • e.g. variables_01, variables_02, variables_03 ...

Other Folders and Files

  1. Image Folder
    • It contains images that are used in the README.md file.
  2. Quick Links
    • Quick links is a file, that contains links to solutions for all exercises(i.e. links to src/main.rs).
β”œβ”€β”€ 01-basic-rust                           // Level
β”‚Β Β  └── 01_hello_world                      // Topic
β”‚Β Β   Β Β  β”œβ”€β”€ Cargo.lock
β”‚Β Β   Β Β  β”œβ”€β”€ Cargo.toml
β”‚Β Β   Β Β  └── hello_world_01                  // Exercise
β”‚Β Β   Β Β   Β Β  β”œβ”€β”€ Cargo.toml
β”‚Β Β   Β Β   Β Β  └── src
β”‚Β Β   Β Β   Β Β      └── main.rs                 // Solution
β”œβ”€β”€ 02-intermediate-rust
β”œβ”€β”€ 03-advanced-rust
β”œβ”€β”€ 04-projects
β”œβ”€β”€images                                   // Images Folder
β”‚Β   └── rust-practice-map.png               // Mind Map
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ QUICK_LINKS.md                          // Direct Links
β”œβ”€β”€ README.md
└── SECURITY.md

You can quickly navigate to solutions using Quick Links.

Exercises

1. Basics Rust (10%)

Hello, World! (0.5%)

Variables and Mutability (1.5%)

Data Types and Casting (3%)

Control Flow (5%)

Functions (7%)

Ownership and Borrowing (10%)

2. Intermediate Rust (20%)

Structs (12%)

Enums and Pattern Matching (14%)

Collections (Vectors, HashMaps) (18%)

Error Handling (21%)

Traits (24%)

Iterators and Closures (28%)

Modules and Crates (30%)

3. Advanced Rust(40%)

Concurrency (35%)

Smart Pointers (Box, Rc, RefCell) (41%)

Asynchronous Programming (47%)

Macros (54%)

Unsafe Rust (63%)

Lifetimes and Generics (70%)

4. Projects (30%)

Command-Line Tool (73%)

Advanced CLI Projects (78%)

Package Building (85%)

Cross-Platform Development (91%)

Integration, Plugins, and Systems (100%)

Contributing 🀝

Contributions are welcome! If you have any suggestions, improvements, or new exercises, feel free to open an issue or submit a pull request. Let's make this repository a valuable resource for everyone learning Rust.

License πŸ“œ

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgment πŸ™

A big thank you to the Rust community and all the contributors who have helped make this repository better. Your support and feedback are greatly appreciated.

Contact πŸ“¬

For any questions or feedback, you can reach out to me on GitHub or Dev.to.