Summary
Understanding how Rust deals with the lifetime of variables is of key importance in ensuring that as few mistakes as possible are made when creating your Rust applications. We have considered how information is moved around functions and seen how the Rust model ensures that we are never left with dangling references or code that is addressing a memory location that no longer belongs to the variable. We have also seen how Rust removes the ability to have data-race conditions.
In the next chapter, we will consider generic types, their importance to your Rust application, and how the compiler deals with them.