Systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

Installing Cargo

Cargo is Rust’s package manager. You can use it to download your project’s dependencies and to compile your project. To install Cargo, type:

$ sudo dnf install cargo

You can start a new project using Cargo by typing:

$ cargo new my_project --bin

This will create a new directory with manifest (Cargo.toml), a source code directory (src) and a “Hello, World!” program in src/

$ cd my_project/
$ tree .
├── Cargo.toml
└── src

1 directory, 2 files

The manifest is written in TOML language and looks like this:

name = "my_project"
version = "0.1.0"
authors = ["Your Name <>"]


To run your new project, type:

$ cargo run
   Compiling my_project v0.1.0 (file:///home/fedora/rust/my_project)
     Running `target/debug/my_project`
Hello, world! repository

Rust calls its compilation unit (either library or executable) a crate. Your project is such a crate and it can also depend on other crates specified in Cargo.toml. The default repository to look for dependencies is but you can also specify dependencies on a git repository.

Note: Cargo currently supports only source dependencies.