Skip to content

Latest commit

 

History

History

_02_hello_cargo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

First Cargo Program

  • You can create a similar directory by typing:

    cargo new _02_hello_cargo
  • This command creates a Cargo.toml file, click on the link at the left to learn more about it.

  • Then, start writing code in src/main.rs.

  • Cargo uses Cargo.lock file to fix the crate versions (aka: package in other langs). It is idiomatic to save this file to git for executable programs. Otherwise, if you're building a rust library, then add this to your .gitignore. To learn why, read this.

  • See this to understand how to run a program using Cargo.


👉 You can also read more about Cargo here.