Practicing Rust based on the Book: 'Learning Rust with Entirely Too Many Linked Lists'
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

NOTES.md 801B

Lessons from Stack 1

When you need to do the ol’ switcheroo with some memory mem::replace comes in useful.

Lessons from Stack 2

take() is handy, read more about this. Sometimes you just have to get your hands dirty and do some lifetimes, just a fact of life, get used to it son. Revise some of these impl types, to understand better how they function with std library collections.

Lessons from Stack 3

and_then() allows you to map over a value returning an option. Useful for when the type mapping is an option.

Lessons from Stack 4

It’s important to conceptualise the invariants before you write code to validate assumptions and edge cases. borrow() and borrow_mut() are important methods when using RefCell. Drop can be implemented with popping until no elements are left.