Welcome to the Rust Basics repository, a collection of foundational Rust programming topics. This project is designed to help learners get started with Rust by exploring key concepts such as variables, data types, control flow, and more.
Rust is a systems programming language that emphasizes performance, safety, and concurrency. This repository will guide you through some of the most important and basic features of the language.
Here is an organized list of topics with a brief description for each:
Topic | Description |
---|---|
Hello World | A simple "Hello, World!" program to get started with Rust. |
Cargo | Learn how to use Cargo, the Rust package manager and build system. |
Unit Test | Writing and running unit tests to ensure code correctness. |
Variable | Understanding variable declarations, mutability, and scoping. |
Comment | Using comments in Rust code for clarity and documentation. |
Data Type | Exploring the basic data types available in Rust (e.g., integers, floats, booleans, etc.). |
Number | Working with numeric types, including integer and floating-point numbers. |
Numeric Operations | Performing basic arithmetic operations like addition, subtraction, and multiplication. |
Boolean | Understanding boolean values and their role in logic and conditions. |
Comparison Operators | Using comparison operators (e.g., == , != , < , > ) to compare values. |
Boolean Operators | Using logical boolean operators (AND, OR, NOT) to combine boolean values. |
Char | Working with characters and understanding the char data type. |
Array | Introduction to arrays in Rust and how to work with them. |
Constant | Defining and using constants in Rust to store fixed values. |
Variable Scope | Understanding the scope of variables and how they affect code behavior. |
To run the examples in this repository:
-
Clone the repository to your local machine:
git clone https://github.com/yogithesymbian/rust_basic.git cd rust_basic
-
Make sure you have Rust installed on your machine. If not, you can install it from Rust's official site.
-
Each topic is separated into a
src
file (e.g.,src/hello_world.rs
,src/cargo.rs
). You can compile and run the code in any of these files with Cargo:cargo run --example hello_world
Replace
hello_world
with the name of any example you want to run.
Feel free to fork the repository, make changes, and create pull requests to contribute new examples, improve documentation, or fix bugs.
This project is licensed under the MIT License - see the LICENSE file for details.
Thank you for exploring Rust with this basic guide! 🎉