These are my notes from reading the Rust Book (2nd edition), including some sample code, as well as all exercise code.
So far, these are the areas of note:
- Temperature converter mini program written in rust view the code
- This was the first recommended exercise in chapter 3
- Fibonacci program that returns nth fib number written in rust view the code
- This was the second recommended exercise in chapter 3
- Twelve days of Christmas lyrics written in rust view the code
- This was the third recommended exercise in chapter 3
- Notes on Ownership, borrowing, and references
- Some personal notes to help retain material I'm reading. Not proofread or organized for that matter. May contain errors, but reflects my understanding of the material at the moment of writing
- Install rust
- Run
cargo new some_name --bin
. This will create a folder namedsome_name
which has the proper directory structure to hold the script that we will be downloading next.$ cargo new some_name --bin
- Either download one of the sample codes above
and overwrite the
main.rs
file found in the previously created directory located at:or copy paste the file contents into the aforementionedsome_name/src/main.rs
main.rs
file. - Change into the directory of the
some_name
folder created earlier$ cd ./some_name
- Run
cargo run
. This should compile the downloaded code and download dependencies, as well as run the program after compilation$ cargo run