Rust Documentation: Chapter 4 - References
In the previous chapter, we saw how ownership works in Rust. The main drawback we saw was that for functions, the return value changes ownership and the original variable is no longer usable. In this chapter, we will look at a continuation of ownership, i.e. references. References Instead of passing variables to functions, we can pass references to functions. reference is like a pointer we can follow to get to the data....