X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/38318e759c8aae48e68e413856289eb436a15b08..3530068c5bbcbd9185757369dd23b9edb3bbc9ad:/src/part04.rs diff --git a/src/part04.rs b/src/part04.rs index 375ef9f..f2a6b6c 100644 --- a/src/part04.rs +++ b/src/part04.rs @@ -99,7 +99,7 @@ fn shared_ref_demo() { // ## Unique, mutable references //@ There is a second way to borrow something, a second kind of reference: The *mutable reference*. This is a reference that comes with the promise -//@ that nobody else has *any kind of access* to the referee - there is no aliasing. It is thus always safe to perform mutation through such a reference. +//@ that nobody else has *any kind of access* to the referee - in contrast to shared references, there is no aliasing with mutable references. It is thus always safe to perform mutation through such a reference. //@ Because there cannot be another reference to the same data, we could also call it a *unique* reference, but that is not their official name. //@ As an example, consider a function which increments every element of a vector by 1.