- This repo contains all my exercise files for my rust basics so feel free to join me on my rust learning journey.
- I used this video as a guide to install Rust on windows. You can follow the documentation as well.
- To start a new rust project run.
cargo new <project-name>
rustup - version manager rustc - compiler (rustc filename.rs
compiles to filename.exe then run ./filname in the terminal). rustup - packakage manager
- rust (rls) by rust-lang for linting
- better TOML by bung... for toml syntax highlighting.
Cargo.toml
- is pretty much like package.json for node.src
is where you write all your rust code.
-
To compile and run the cargo project use.
cargo run
-
To build the project.
cargo build
-
If your building for production. add the
--release
flag. -
To go through documentation.
cargo doc --open
-
To update crates
cargo update
-
Oh btw rust files cant start with a number as a name so
1print.rs
wont work.
Summaries From Rust Book.
- Print Statement & Formatting with code.
- Variables In Rust with code.
- Datatypes In Rust with code.
- Strings In Rust with code.
- Tuples in Rust with code
- Arrays in Rust with code
- Vectors in Rust with code
- Functions in Rust.
- Control Flow in Rust with code