Rust - Cargo - New


Use $ cargo new <project_name> to create a new Rust project. This command will create a nested directory containing a Cargo.toml file and a srs/ directory containing a basic source file. In addition, it will initialize a git repository for the project.

The Cargo.toml file is Cargo's configuration file for packages. In Rust, packages of code are called "crates".

Flags:

  • --lib: Initialize a library (make src/lib.rs)