Programming
Rust
Installation
We recommend using rustup to install Rust.
Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shUpdate using rustup
You can update Rust to the latest version using rustup:
rustup updateCreate a new cargo project
For a binary, i.e., an executable program:
Create a new directory named my_project and initialize a new Cargo project inside it:
cargo new my_projectAlternatively, you can initialize a new Cargo project in an existing directory:
mkdir my_project
cd my_project
cargo initFor a library:
cargo new my_library --libor
mkdir my_library
cd my_library
cargo init --libcargo new pkg-namecreates a new directory.cargo initinitializes a new project in the current directory.