Page cover

Getting Started

Rust and Cargo

writing code

fn main(){ //main function
 println!("hello"); //print statement
}

compiling the code

rustc <filename>

Cargo

making new project

cargo new <package name>

For building the project

cargo build hello.rs

For checking the code but not making executable

cargo check

For running the project

cargo run  

OR

./target/debug/hello_cargo

Last updated

Was this helpful?