Auto merge of #95610 - createyourpersonalaccount:derefmut-docfix, r=Dylan-DPC
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:
commit
2ad4eb207b
1 changed files with 1 additions and 1 deletions
|
@ -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 = "*")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue