Add new lint [`misnamed-getters`] ``` changelog: Add new lint [`misnamed-getters`] ``` Closes #9769 The current lint matches all methods with a body of just one expression under the form `(&mut?)? <expr>.field` where field doesn't match the name of the method but there is a field of the same type in `<expr>` that matches the name. This allows matching nested structs, for example for newtype wrappers. This may cast the net a bit too wide and cause false positives. I'll run [clippy_lint_tester](https://github.com/mikerite/clippy_lint_tester) on the top crates to see how frequently false positives happen. There also may be room for improvement by checking that the replacement field would work taking into account implementations of `Deref` and `DerefMut` even if the types don't exactly match but I don't know yet how this could be done. |
||
|---|---|---|
| .. | ||
| misnamed_getters.rs | ||
| mod.rs | ||
| must_use.rs | ||
| not_unsafe_ptr_arg_deref.rs | ||
| result.rs | ||
| too_many_arguments.rs | ||
| too_many_lines.rs | ||