Commit graph

8 commits

Author SHA1 Message Date
Michael Wright
750a2d57bd Fix unnecessary_to_owned false positive
Fixes #9351.

Note that this commit reworks that fix for #9317. The change
is to check that the type implements `AsRef<str>` before regarding
`to_string` as an equivalent of `to_owned`. This was suggested
by Jarcho in the #9317 issue comments.

The benefit of this is that it moves some complexity out of
`check_other_call_arg` and simplifies the module as a whole.
2022-09-03 17:00:44 +02:00
xphoniex
1a2aaf68de
Skip unnecessary_to_owned when t != t.to_string()
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-08-14 16:29:26 +00:00
Samuel E. Moelius III
91a822c162 Address unnecessary_to_owned false positive 2022-05-06 09:31:27 -04:00
kyoto7250
dfdc5ad7d8 fix unnecessary_to_owned about msrv 2022-04-12 22:59:25 +09:00
Samuel E. Moelius III
1a95590faf Fix #8507 2022-03-05 21:18:44 -05:00
Samuel E. Moelius III
3807905e08 Handle to_vec on for loop expression #8069 2021-12-13 07:04:57 -05:00
Samuel E. Moelius III
290f74be4e Address review comments
* Share a list of methods with `implicit_clone`
* Ensure no overlap with `redundant_clone`
2021-12-13 06:31:17 -05:00
Samuel E. Moelius III
468c86e4a3 Add unnecessary_to_owned lint 2021-12-13 06:31:17 -05:00