This GitHub repository is your Rust programming playground, no matter your skill level! Beginners can start with easy programs to learn the ropes. Intermediate coders can tackle trickier problems to test their knowledge. And for the Rust experts, there are complex programs to push your limits. But it's more than just exercises! Share your own programs, challenge others, and learn together as a team.
So come explore the world of Rust - it's fast, safe, and lets you write awesome code! οΈβ¨
-
Download Installer:
- π₯ Go to the Rust website: Rust Website.
- π±οΈ Click to get the installer for Windows.
-
Run Installer:
- π» Double-click the installer you downloaded.
- π Follow the steps shown on the screen.
- π οΈ Rustup, Rust's tool manager, will install with Rust.
-
Using Rustup:
- π§ Open your terminal.
- β¨οΈ Put this in the terminal and press enter:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- π Follow the directions on your screen.
- π οΈ Rustup will get Rust and take care of it for you.
-
Environment Variable:
- π§ You need to add rustc to your environment variables.
-
Install Cargo:
-
Compilation:
- π₯οΈ Open your terminal and go to your project folder.
- π Type this command, replacing
your_file.rs
with your file's name:rustc your_file.rs
- π This makes an executable file named
your_file
.
-
Execution:
- πββοΈ After it compiles without errors, run this in the terminal:
./your_file
- πββοΈ After it compiles without errors, run this in the terminal:
-
Creating a New Project:
- π₯οΈ Open your terminal.
- π Type this to make a new Rust project:
cargo new my_project
- π This creates a new folder called
my_project
with stuff inside.
-
Navigating to Your Project:
- πΆββοΈ Go into your project folder:
cd my_project
- πΆββοΈ Go into your project folder:
-
Writing Code:
- βοΈ Use a text editor to open
src/main.rs
. - π Write your Rust code here.
- βοΈ Use a text editor to open
-
Running Your Project:
- πββοΈ Type this to build and run your Rust project:
cargo run
- π Cargo handles everything for you, like getting what your project needs and running it.
- πββοΈ Type this to build and run your Rust project: