CargoCheatSheet 2
CargoCheatSheet 2
RUST PACKAGE MANAGER Step 1: Create a new file called hello.rs, with the following:
HOW TO USE CARGO?
fn main() {
println!("Hello, world!");
WHAT IS RUST AND WHY DO WE LOVE IT? }
Cargo is a smart client that gives you the ability to build, run and test your
projects. Here are some useful Cargo commands that take you through a Step 2: Compile it by running the following command:
typical workflow: $ rustc hello.rs
Rust was introduced in 2010 by Graydon Hoare of
Mozilla Research. Rust is a low-level • Build your project: Run the binary that just created (hello) by running the following
$ cargo build command:
statically-typed multi-paradigm programming
language that’s focused on safety and $ ./hello
performance, similar to C and C++, and is fast and • Run your project:
memory-efficient with no garbage collections. $ cargo run