about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolaos Chatzikonstantinou <nchatz314@gmail.com>2022-04-03 12:42:19 +0900
committerNikolaos Chatzikonstantinou <nchatz314@gmail.com>2022-04-03 12:42:19 +0900
commit53887a5d9ee9b81bdcf8200787fa90d1710bb32d (patch)
tree4978f35e84f99062311a4eb6b69b44e0a27757b4
parentc1550e3f8c57b0ebb0edb3a7ea64727e668f669c (diff)
downloadrust-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.rs2
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 = "*")]