Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.52 KB

setup-env.md

File metadata and controls

61 lines (40 loc) · 1.52 KB

Setup environment

Rust is installed through rustup, a command line tool for managing Rust versions and associated tools.

curl https://sh.rustup.rs -sSf | sh

To update Rust

rustup update

rustc is the compiler for the Rust programming language, provided by the project itself. Most Rust programmers don't invoke rustc directly, but instead do it through Cargo.

Cargo

Cargo is the Rust package manager. Cargo downloads your Rust package’s dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io

Create a project

Clone this repository

git clone [email protected]:Cutii/rustii.git && cd rustii

To build your project run

cargo build # build
cargo run #build & run
cargo test #run unit tests
cargo release #build in production mode

If you would create a new project from scratch, you could do :

cargo new my_project

Or if you want to creat a lib

cargo new my_project --lib

You can also initialize a project from an existing repository

cargo init

You can notice the presence of a cargo.toml file which is call the manifest. Every manifest file consists of one or more sections : package description, depencies management, configuration, ...

Tools