Time to learn some rust!!
To install rust, follow the instructions on the official rust website.
All rust code is in the src/bin directory. To run the code, use the command cargo run
in the root directory of the project.
Each file in the src directory is a separate rust program. To run a specific program, use the command cargo run --bin <filename>
.
eg: cargo run --bin variables
Each rust program is wrapped inside a main
function. The main
function is the entry point of the program.
Convention | Types that use it |
---|---|
snake_case |
Crates, modules, functions, methods, local variables and parameters, lifetimes. |
CamelCase |
Types (including traits and enums), type parameters in generics. |
SCREAMING_SNAKE_CASE |
Constant and static variables. |