~irimi1/learning-rust

d4fc5b017baed639e8f87631b6523fb68b7a56dd — Manuel Groß 1 year, 2 months ago 16096b8 master
Begin notes for chapter 13
1 files changed, 4 insertions(+), 0 deletions(-)

M notes.md
M notes.md => notes.md +4 -0
@@ 132,3 132,7 @@ These are things from the book I want to have in a document to quickly find agai

- Per convention, programs should be split into a `main.rs` and a `lib.rs`, where the latter contains all the logic, and the main handles running the program.
- Lifetimes are a way to tell the compiler what input of a function the return value is connected to. If it’s e.g. a reference to something contained in an input argument, it needs to be valid for the same scope. Otherwise the reference would become invalid.

# Chapter 13

- Closures are anonymous functions that can be saved in variables or passed to functions.