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.
This commit is contained in:
Nikolaos Chatzikonstantinou 2022-04-03 12:42:19 +09:00
parent c1550e3f8c
commit 53887a5d9e
No known key found for this signature in database
GPG Key ID: 0ED351EB371E6448

View File

@ -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 = "*")]