-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
There are several (many?) instances in rust/src where one has, for example,
match a_function_returning_option() {
Some(ref a) => { move_a(a.clone()) }
None => { do_whatever() }
}
The ref a
is entirely unnecessary; a
could be moved out in the pattern, saving a clone.
(This would have to be careful to not lint when e.g. a
is used as a reference in the body, and probably other situations.)
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.