mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
5013f49195
Cleaning the empty lines for clarity.
50 lines
2 KiB
Text
50 lines
2 KiB
Text
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|
--> $DIR/entry.rs:13:5
|
|
|
|
|
13 | if !m.contains_key(&k) { m.insert(k, v); }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k).or_insert(v)`
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/entry.rs:5:9
|
|
|
|
|
5 | #![deny(map_entry)]
|
|
| ^^^^^^^^^
|
|
|
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|
--> $DIR/entry.rs:17:5
|
|
|
|
|
17 | if !m.contains_key(&k) { foo(); m.insert(k, v); }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
|
|
|
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|
--> $DIR/entry.rs:21:5
|
|
|
|
|
21 | if !m.contains_key(&k) { m.insert(k, v) } else { None };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
|
|
|
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|
--> $DIR/entry.rs:25:5
|
|
|
|
|
25 | if m.contains_key(&k) { None } else { m.insert(k, v) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
|
|
|
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|
--> $DIR/entry.rs:29:5
|
|
|
|
|
29 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
|
|
|
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
|
--> $DIR/entry.rs:33:5
|
|
|
|
|
33 | if m.contains_key(&k) { None } else { foo(); m.insert(k, v) };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
|
|
|
|
error: usage of `contains_key` followed by `insert` on a `BTreeMap`
|
|
--> $DIR/entry.rs:37:5
|
|
|
|
|
37 | if !m.contains_key(&k) { foo(); m.insert(k, v) } else { None };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `m.entry(k)`
|
|
|
|
error: aborting due to 7 previous errors
|
|
|