From 53887a5d9ee9b81bdcf8200787fa90d1710bb32d Mon Sep 17 00:00:00 2001 From: Nikolaos Chatzikonstantinou Date: Sun, 3 Apr 2022 12:42:19 +0900 Subject: [PATCH] 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. --- library/core/src/ops/deref.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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 = "*")]