Skip to content

Commit

Permalink
Auto merge of rust-lang#95610 - createyourpersonalaccount:derefmut-do…
Browse files Browse the repository at this point in the history
…cfix, 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.
  • Loading branch information
bors committed Apr 3, 2022
2 parents 168a020 + 53887a5 commit 2ad4eb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "*")]
Expand Down

0 comments on commit 2ad4eb2

Please sign in to comment.