Skip `unnecessary_to_owned` when `t != t.to_string()` Fixes #9317 changelog: [`unnecessary_to_owned`]: none