We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code samples that illustrate the Option::iter_mut() and Result::iter_mut() use an overcomplicated pattern. For instance:
Some(&mut ref mut v) => *v = 42,
could be simplified to this:
Some(v) => *v = 42,
or, if we want to make it explicit that the value is a &mut T, to this:
&mut T
Some(ref mut v) => **v = 42,
but then we need to dereference twice.
In any case, the current sample code seems to bring a lot of confusion for no good reason.
The text was updated successfully, but these errors were encountered:
Auto merge of #28432 - aochagavia:docs2, r=alexcrichton
f18c2aa
Fixes #28431
No branches or pull requests
The code samples that illustrate the Option::iter_mut() and Result::iter_mut() use an overcomplicated pattern. For instance:
could be simplified to this:
or, if we want to make it explicit that the value is a
&mut T
, to this:but then we need to dereference twice.
In any case, the current sample code seems to bring a lot of confusion for no good reason.
The text was updated successfully, but these errors were encountered: