rust-clippy/tests/ui/entry.stderr

47 lines
1.9 KiB
Text
Raw Normal View History

error: usage of `contains_key` followed by `insert` on a `HashMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:13:5
|
13 | if !m.contains_key(&k) { m.insert(k, v); }
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k).or_insert(v)`
|
= note: `-D map-entry` implied by `-D warnings`
error: usage of `contains_key` followed by `insert` on a `HashMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:17:5
|
17 | if !m.contains_key(&k) { foo(); m.insert(k, v); }
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:21:5
|
21 | if !m.contains_key(&k) { m.insert(k, v) } else { None };
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:25:5
|
25 | if m.contains_key(&k) { None } else { m.insert(k, v) };
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:29:5
|
29 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `HashMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:33:5
|
33 | if m.contains_key(&k) { None } else { foo(); m.insert(k, v) };
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
error: usage of `contains_key` followed by `insert` on a `BTreeMap`
2017-08-01 15:54:21 +00:00
--> $DIR/entry.rs:37:5
|
37 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `m.entry(k)`
2018-01-16 16:06:27 +00:00
error: aborting due to 7 previous errors