fix: unnecessary_to_owned FP when map key is a reference (#14834)
Closes rust-lang/rust-clippy#14833 changelog: [`unnecessary_to_owned`] fix FP when map key is a reference
This commit is contained in:
commit
375c65030b
3 changed files with 28 additions and 6 deletions
|
|
@ -675,3 +675,9 @@ mod issue_14242 {
|
|||
rc_slice_provider().to_vec().into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
fn issue14833() {
|
||||
use std::collections::HashSet;
|
||||
let mut s = HashSet::<&String>::new();
|
||||
s.remove(&"hello".to_owned());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -675,3 +675,9 @@ mod issue_14242 {
|
|||
rc_slice_provider().to_vec().into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
fn issue14833() {
|
||||
use std::collections::HashSet;
|
||||
let mut s = HashSet::<&String>::new();
|
||||
s.remove(&"hello".to_owned());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue