A minimal Rust project that prints a greeting, accepts a name from the command line, includes a test suite, and uses a Makefile to drive common tasks. This tutorial covers project setup with Cargo, module organization, argument parsing with std::env, unit tests, and build automation.
Prerequisites Rust 1.70 or later (install via rustup) A Unix-like terminal (macOS, Linux, or WSL on Windows) make installed (pre-installed on macOS and most Linux distributions) No third-party crates required Step 1: Create the project with Cargo Create the file cargo new hello-world Detailed breakdown cargo new hello-world scaffolds a new Rust project with a Cargo.toml manifest and a src/main.rs entry point. When run outside an existing Git repository, Cargo also initializes a new Git repo and generates a .gitignore. When run inside an existing repo (as in this tutorial), it skips Git initialization. The project name hello-world becomes both the directory name and the package name in Cargo.toml. Step 2: Update the gitignore The default Cargo .gitignore only excludes target/. Add common temporary artifacts.
...