diff options
| author | Nikolaos Chatzikonstantinou <nchatz314@gmail.com> | 2022-04-03 12:42:19 +0900 |
|---|---|---|
| committer | Nikolaos Chatzikonstantinou <nchatz314@gmail.com> | 2022-04-03 12:42:19 +0900 |
| commit | 53887a5d9ee9b81bdcf8200787fa90d1710bb32d (patch) | |
| tree | 4978f35e84f99062311a4eb6b69b44e0a27757b4 | |
| parent | c1550e3f8c57b0ebb0edb3a7ea64727e668f669c (diff) | |
| download | rust-53887a5d9ee9b81bdcf8200787fa90d1710bb32d.tar.gz rust-53887a5d9ee9b81bdcf8200787fa90d1710bb32d.zip | |
Improve doc example of DerefMut
It is more illustrative, after using `*x` to modify the field, to show in the assertion that the field has indeed been modified.
| -rw-r--r-- | library/core/src/ops/deref.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/ops/deref.rs b/library/core/src/ops/deref.rs index fb4ec83bc28..d68932402a4 100644 --- a/library/core/src/ops/deref.rs +++ b/library/core/src/ops/deref.rs @@ -164,7 +164,7 @@ impl<T: ?Sized> const Deref for &mut T { /// /// let mut x = DerefMutExample { value: 'a' }; /// *x = 'b'; -/// assert_eq!('b', *x); +/// assert_eq!('b', x.value); /// ``` #[lang = "deref_mut"] #[doc(alias = "*")] |
