]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/entry_btree.stderr
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / clippy / tests / ui / entry_btree.stderr
1 error: usage of `contains_key` followed by `insert` on a `BTreeMap`
2   --> $DIR/entry_btree.rs:12:5
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`
11 help: try this
12    |
13 LL ~     if let std::collections::btree_map::Entry::Vacant(e) = m.entry(k) {
14 LL +         e.insert(v);
15 LL +         foo();
16 LL +     }
17    |
18
19 error: aborting due to previous error
20