diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-06-02 09:37:54 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-06-02 09:37:54 -0400 |
| commit | e1a33aa98758252c806d0bf1966690fe6c96291b (patch) | |
| tree | 20a5252ca812e92fbc1d7641a9177c23025e509e | |
| parent | 48e9ef640480a5371759d011da7acbe2fa182511 (diff) | |
| download | rust-e1a33aa98758252c806d0bf1966690fe6c96291b.tar.gz rust-e1a33aa98758252c806d0bf1966690fe6c96291b.zip | |
Link to cell in TRPL: mutability
| -rw-r--r-- | src/doc/trpl/mutability.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/doc/trpl/mutability.md b/src/doc/trpl/mutability.md index e30825badcc..ef569a09e21 100644 --- a/src/doc/trpl/mutability.md +++ b/src/doc/trpl/mutability.md @@ -159,7 +159,7 @@ b.x = 10; // error: cannot assign to immutable field `b.x` [struct]: structs.html -However, by using `Cell<T>`, you can emulate field-level mutability: +However, by using [`Cell<T>`][cell], you can emulate field-level mutability: ```rust use std::cell::Cell; @@ -176,4 +176,6 @@ point.y.set(7); println!("y: {:?}", point.y); ``` +[cell]: ../std/cell/struct.Cell.html + This will print `y: Cell { value: 7 }`. We’ve successfully updated `y`. |
