mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-09-21 07:01:54 +00:00
Add unnecessary_to_owned
"Known problems" section
This commit is contained in:
parent
a4ebf6f78e
commit
366234a515
1 changed files with 5 additions and 0 deletions
|
@ -1895,6 +1895,11 @@ declare_clippy_lint! {
|
|||
/// ### Why is this bad?
|
||||
/// The unnecessary calls result in useless allocations.
|
||||
///
|
||||
/// ### Known problems
|
||||
/// `unnecessary_to_owned` can falsely trigger if `IntoIterator::into_iter` is applied to an
|
||||
/// owned copy of a resource and the resource is later used mutably. See
|
||||
/// [#8148](https://github.com/rust-lang/rust-clippy/issues/8148).
|
||||
///
|
||||
/// ### Example
|
||||
/// ```rust
|
||||
/// let path = std::path::Path::new("x");
|
||||
|
|
Loading…
Reference in a new issue