You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The warning doesn't take into account that the contains_key() / insert() sequence has some code that is necessary in between (it could also apply if the push() was placed after the insert(). For context, this is inside a loop iterating over rows and the Hashmap seen is used to prevent inserting duplicates into the vector v. AFAICT (I've tried several variations of using Entry methods), using the suggested or_insert() does not provide a solution.
The text was updated successfully, but these errors were encountered:
Yes, that works (except for having to use url.clone() in the first rather than the second one). I'm still wondering, though, whether the warning is always valid, irrespective of other code in the block following the contains_key().
There are cases. entry() mutably borrows the Hashmap so the suggestion is invalid if you're using the hashmap for something else in the block. See #4674.
Version: clippy 0.0.212 (d4092ac 2020-05-11)
I get the following warning:
The warning doesn't take into account that the
contains_key()
/insert()
sequence has some code that is necessary in between (it could also apply if thepush()
was placed after theinsert()
. For context, this is inside a loop iterating over rows and the Hashmapseen
is used to prevent inserting duplicates into the vectorv
. AFAICT (I've tried several variations of usingEntry
methods), using the suggestedor_insert()
does not provide a solution.The text was updated successfully, but these errors were encountered: