]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/entry_fixable.rs
Auto merge of #55617 - oli-obk:stacker, r=nagisa,oli-obk
[rust.git] / src / tools / clippy / tests / ui / entry_fixable.rs
1 // run-rustfix
2
3 #![allow(unused, clippy::needless_pass_by_value)]
4 #![warn(clippy::map_entry)]
5
6 use std::collections::{BTreeMap, HashMap};
7 use std::hash::Hash;
8
9 fn foo() {}
10
11 fn insert_if_absent0<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
12     if !m.contains_key(&k) {
13         m.insert(k, v);
14     }
15 }
16
17 fn main() {}