This tutorial explains how to use Cargo
tool in Rust
.
Cargo
is Rust's
build system and package manager.
Cargo
comes installed with Rust
installation.
For following below instructions rust
and VsCode
installation is required,
if you don't have rust
installed, follow link
install rust on windows.
Cargo
installation version
E:\rust-tutorials> cargo --version
#### Output ####
cargo 1.48.0 (65cbdd2dc 2020-10-14)
Cargo
E:\rust-tutorials\first-project>cargo new test_cargo
#### Output ####
Created binary (application) `test_cargo` package
VsCode
E:\rust-tutorials\first-project>cd test_cargo
E:\rust-tutorials\first-project\test_cargo>code .
E:.
│ .gitignore
│ Cargo.toml
│
└───src
main.rs
Cargo
project with below command
E:\rust-tutorials\first-project\test_cargo>cargo build
#### Output ####
Compiling test_cargo v0.1.0 (E:\rust-tutorials\first-project\test_cargo)
Finished dev [unoptimized + debuginfo] target(s) in 1.07s
Cargo
project
E:\rust-tutorials\first-project\test_cargo>.\target\debug\test_cargo.exe
#### Output ####
Hello, world!
Similar Articles