No description
Find a file
2020-05-22 16:48:09 +02:00
enum_example enum_example: Add default case in match 2020-05-22 16:48:09 +02:00
fibonacci Add fibonacci number generator 2020-05-02 19:25:38 +02:00
guessing_game Add guessing game 2020-05-01 20:20:57 +02:00
hello_cargo Initial commit - Hello Cargo 2020-05-01 20:20:55 +02:00
rectangles rectangles: Add associated function 2020-05-22 14:12:11 +02:00
some_example Some enum example 2020-05-22 16:45:58 +02:00
string_slicing string slicing: enhance API to accept string slices 2020-05-22 13:28:50 +02:00
struct_example Tuple structs are a thing 2020-05-22 13:47:13 +02:00
temperature_convertor Add temperature convertor 2020-05-02 19:22:02 +02:00
twelve_days_of_christmas Add twelve days of christmas 2020-05-02 19:32:05 +02:00
.gitignore Initial commit - Hello Cargo 2020-05-01 20:20:55 +02:00
README.md Add temperature convertor 2020-05-02 19:22:02 +02:00

Rust "The Book" exercices

A collection of the examples/exercices/... found in the rust tutorial "The Book", collected for my own reference.

Interesting commands

Compile

  1. Debug
$> cargo build
  1. Release
$> cargo build --release
  1. Check

This is usefull in f.e. CI's to quickly check if our project can compile:

$> cargo check

Documentation

Make and open the documentation in your favorite web browser:

$> cargo doc --open

Format

To format the code:

$> cargo fmt

Interesting things to know

  • A char is 4 bytes in Rust!

  • Breaking with a value is only possible inside a 'loop' not a 'while/for' loop!