mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
5a28d8f01e
fix false positive in Issue/12098 because lack of consideration of mutable caller fixes [Issue#12098](https://github.com/rust-lang/rust-clippy/issues/12098) In issue#12098, the former code doesn't consider the caller for clone is mutable, and suggests to delete clone function. In this change, we first get the inner caller requests for clone, and if it's immutable, the following code will suggest deleting clone. If it's mutable, the loop will check whether a borrow check violation exists, if exists, the lint should not execute, and the function will directly return; otherwise, the following code will handle this. changelog: [`clippy::unnecessary_to_owned`]: fix false positive |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |