I can give an actual code example from a while ago. Compare the communicated amount of information in
match state {
SelectContentState::Open { mut source, builder } => {...},
SelectContentState::Content { source, mut stream, tag } => {...},
SelectContentState::Close { mut source, tag } => {...},
}
with
match state {
SelectContentState::Open { source, builder } => {...},
SelectContentState::Content { source, stream, tag } => {...},
SelectContentState::Close { source, tag } => {...},
}
The actual ... blocks of course contain some complicated state changes, so fully knowing if something is mutated or not might be hard to determine on a glance.
A similar thing applies to the new match rules. Given a fn get() returning a &mut Something, I prefer
match *foo.get() {
Something::A { ref a, ref mut b } => {...},
Something::B { ref mut a, ref b } => {...},
}
over
match foo.get() {
Something::A { a, b } => {...},
Something::B { a, b } => {...},
}
(Note: A get would usually be get_mut, it’s just a stand-in here for some process resulting in a mutable reference.)