Closed
Description
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:
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.
Metadata
Metadata
Assignees
Labels
No labels