Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Rust Programming Tutorial #16 – References

39.8K views on YouTube

dcode 42 tutorials here

In this video I talk about references and borrowing in Rust – there are two types of references: immutable and mutable.

Immutable references don’t allow you to change the value of the resource you are referring to while mutable references do allow this.

As read from the Rust documentation:
(https://doc.rust-lang.org/1.12.0/book/references-and-borrowing.html)

– You can have multiple immutable references to a variable in the same scope.

OR

– You can have 0 or exactly 1 mutable reference to a variable in the same scope.

Only one at a time.

If this video helped you out and you’d like to see more, make sure to leave a like and subscribe to dcode!