From: Ralf Jung Date: Mon, 18 Jan 2016 18:18:26 +0000 (+0100) Subject: mutable references wording X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/20c3754739514b710a2e6744c9fd43bcb83c4706?ds=inline;hp=-c mutable references wording --- 20c3754739514b710a2e6744c9fd43bcb83c4706 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.