]>
Commit | Line | Data |
---|---|---|
c295e0f8 | 1 | error: usage of `contains_key` followed by `insert` on a `BTreeMap` |
c620b35d | 2 | --> tests/ui/entry_btree.rs:10:5 |
c295e0f8 XL |
3 | | |
4 | LL | / if !m.contains_key(&k) { | |
5 | LL | | m.insert(k, v); | |
6 | LL | | foo(); | |
7 | LL | | } | |
8 | | |_____^ | |
9 | | | |
10 | = note: `-D clippy::map-entry` implied by `-D warnings` | |
781aab86 | 11 | = help: to override `-D warnings` add `#[allow(clippy::map_entry)]` |
add651ee | 12 | help: try |
c295e0f8 XL |
13 | | |
14 | LL ~ if let std::collections::btree_map::Entry::Vacant(e) = m.entry(k) { | |
15 | LL + e.insert(v); | |
16 | LL + foo(); | |
17 | LL + } | |
18 | | | |
19 | ||
4b012472 | 20 | error: aborting due to 1 previous error |
c295e0f8 | 21 |