1 error: usage of `contains_key` followed by `insert` on a `HashMap`
4 23 | if !m.contains_key(&k) { m.insert(k, v); }
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k).or_insert(v)`
7 = note: `-D clippy::map-entry` implied by `-D warnings`
9 error: usage of `contains_key` followed by `insert` on a `HashMap`
10 --> $DIR/entry.rs:27:5
12 27 | if !m.contains_key(&k) { foo(); m.insert(k, v); }
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
15 error: usage of `contains_key` followed by `insert` on a `HashMap`
16 --> $DIR/entry.rs:31:5
18 31 | if !m.contains_key(&k) { m.insert(k, v) } else { None };
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
21 error: usage of `contains_key` followed by `insert` on a `HashMap`
22 --> $DIR/entry.rs:35:5
24 35 | if m.contains_key(&k) { None } else { m.insert(k, v) };
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
27 error: usage of `contains_key` followed by `insert` on a `HashMap`
28 --> $DIR/entry.rs:39:5
30 39 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
33 error: usage of `contains_key` followed by `insert` on a `HashMap`
34 --> $DIR/entry.rs:43:5
36 43 | if m.contains_key(&k) { None } else { foo(); m.insert(k, v) };
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
39 error: usage of `contains_key` followed by `insert` on a `BTreeMap`
40 --> $DIR/entry.rs:47:5
42 47 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
45 error: aborting due to 7 previous errors