🚀 Hello, Cargo! ✨
Hello World (with Cargo)
Overview
A tutorial for  
 Hello World!
  based program built via Cargo
: a Rust’s build system and package manager.
Tip
This tutorial is based on Rust Book and Rust By Example.
Key Concepts
- Create new binary project using
cargo new hello-world
- Build & run the project using
cargo run
Prerequisites
Rust
(stable, with cargo installed)
Quick Start
Setup
- Create a new binary project using
cargo new hello-world
:
cargo new hello-world
or
cargo new hello-world --bin
Note
By default, cargo new
creates a binary (application) template. You can use --bin
flag to explicitly specify it.
- Build & run the project using
cargo run
:
cd hello-world
cargo run
Tip
Run cargo run --help
or cargo help run
to see detailed options of cargo run
command.
You should see the following output:
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/hello-world`
Hello, world!
Important
cargo run
compiles/builds the code and then run the resultant executable all in one command.
Full Changelog: https://github.com/mohammadzainabbas/rust-from-dust/commits/v1.0