Files
rust/clippy_lints/src
bors 05de787089 Auto merge of #10913 - y21:issue10033, r=Manishearth,Centri3
[`unnecessary_to_owned`]: check that the adjusted type matches target

Fixes #10033.

Before this change, the lint would assume that removing the `.to_string()` in `f(&x.to_string())` would be ok if x is of some type that implements `Deref<Target = str>` and `f` takes a `&str`.
This turns out to not actually be ok if the `to_string` call is some method that exists on `x` directly, which happens if it implements `Display`/`ToString` itself.

changelog: [`unnecessary_to_owned`]: only lint if the adjusted receiver type actually matches
2023-06-09 08:52:44 +00:00
..
2023-06-03 14:38:16 -05:00
2023-03-21 15:38:51 +00:00
2023-04-25 16:31:51 +00:00
2022-10-27 18:41:26 +04:00
2023-06-02 14:46:27 +02:00
2022-12-28 18:52:36 +01:00
2023-03-14 17:18:26 +00:00
2023-02-16 03:39:59 +00:00
2022-01-23 19:31:32 +08:00
2023-03-28 01:14:28 +00:00
2023-06-05 15:48:57 +02:00
2022-04-30 13:51:49 +02:00
2023-05-23 17:22:23 +02:00