Skip to content

tevko/learning-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Notes on Learning rust

  • using a ! means that you’re calling a macro instead of a normal function in rust println! is a macro, while println is a function

  • rustc is the command that compiles a file and generates a binary

  • Cargo is Rust’s package manager and build system

  • Cargo handles building code, as well as downloading and installing dependencies

  • Cargo comes preinstalled on official channels

$ cargo new hello_cargo
$ cd hello_cargo
  • above command creates a new directory called hello_cargo ready for rust development and with a newly initiated git repository. The default program is a hello world program
  • the TOML file is the configuration file for the project
  • packages (crates) are listed in this TOML file
  • Cargo expects your source files to live inside the src directory

Getting user input

To obtain user input and then print the result as output, we need to bring the io input/output library into scope. The io library comes from the standard library, known as std:

use std::io;

About

Me, learning rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages