1 error: usage of `contains_key` followed by `insert` on a `HashMap`
2 --> $DIR/entry_with_else.rs:16:5
4 LL | / if !m.contains_key(&k) {
7 LL | | m.insert(k, v2);
11 = note: `-D clippy::map-entry` implied by `-D warnings`
14 LL ~ match m.entry(k) {
15 LL + std::collections::hash_map::Entry::Vacant(e) => {
18 LL + std::collections::hash_map::Entry::Occupied(mut e) => {
24 error: usage of `contains_key` followed by `insert` on a `HashMap`
25 --> $DIR/entry_with_else.rs:22:5
27 LL | / if m.contains_key(&k) {
28 LL | | m.insert(k, v);
30 LL | | m.insert(k, v2);
36 LL ~ match m.entry(k) {
37 LL + std::collections::hash_map::Entry::Occupied(mut e) => {
40 LL + std::collections::hash_map::Entry::Vacant(e) => {
46 error: usage of `contains_key` followed by `insert` on a `HashMap`
47 --> $DIR/entry_with_else.rs:28:5
49 LL | / if !m.contains_key(&k) {
50 LL | | m.insert(k, v);
58 LL ~ if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
65 error: usage of `contains_key` followed by `insert` on a `HashMap`
66 --> $DIR/entry_with_else.rs:34:5
68 LL | / if !m.contains_key(&k) {
71 LL | | m.insert(k, v);
77 LL ~ if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
84 error: usage of `contains_key` followed by `insert` on a `HashMap`
85 --> $DIR/entry_with_else.rs:40:5
87 LL | / if !m.contains_key(&k) {
88 LL | | m.insert(k, v);
90 LL | | m.insert(k, v2);
96 LL ~ match m.entry(k) {
97 LL + std::collections::hash_map::Entry::Vacant(e) => {
100 LL + std::collections::hash_map::Entry::Occupied(mut e) => {
106 error: usage of `contains_key` followed by `insert` on a `HashMap`
107 --> $DIR/entry_with_else.rs:46:5
109 LL | / if m.contains_key(&k) {
110 LL | | if true { m.insert(k, v) } else { m.insert(k, v2) }
112 LL | | m.insert(k, v)
118 LL ~ match m.entry(k) {
119 LL + std::collections::hash_map::Entry::Occupied(mut e) => {
120 LL + if true { Some(e.insert(v)) } else { Some(e.insert(v2)) }
122 LL + std::collections::hash_map::Entry::Vacant(e) => {
129 error: usage of `contains_key` followed by `insert` on a `HashMap`
130 --> $DIR/entry_with_else.rs:52:5
132 LL | / if m.contains_key(&k) {
134 LL | | m.insert(k, v)
142 LL ~ if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
144 LL + Some(e.insert(v))
150 error: aborting due to 7 previous errors