# Modules ## Example Execute the following command to run [`./solutions/examples/mods.rs`](https://github.com/Cyfrin/rust-crash-course/blob/main/topics/modules/solutions/examples/mods.rs) ```shell cargo run --example mods ``` ## Exercises Exercises are in [`./exercises/src/main.rs`](https://github.com/Cyfrin/rust-crash-course/blob/main/topics/modules/exercises/src/main.rs) ### Exercise 1 Split the modules inside `main.rs` into separate files. ## Test ```shell cargo run ```
Execute the following command to run ./solutions/examples/mods.rs
Exercises are in ./exercises/src/main.rs
Split the modules inside main.rs into separate files.
A hands-on guide to Rust's Module System - Learn to structure your Rust projects by organizing code into modules and separating them into distinct files. You'll practice this by refactoring modules from `main.rs` into a more organized, multi-file project structure.
Course Overview
About the course
Introduction to the Rust programming language
Rust variables and functions
Scalar types, arrays, strings, enum, structs, vectors, and hash maps in Rust
Rust control flows: If / else, if let and let else, loop, match
Rust ownership, including borrow and references
Rust error handling
Rust Modules
Rust Traits
Last updated on November 7, 2025
Rust Developer
Rust Programming BasicsCourse Overview
About the course
Introduction to the Rust programming language
Rust variables and functions
Scalar types, arrays, strings, enum, structs, vectors, and hash maps in Rust
Rust control flows: If / else, if let and let else, loop, match
Rust ownership, including borrow and references
Rust error handling
Rust Modules
Rust Traits
Last updated on November 7, 2025