Skip to content

Commit 5c760f0

Browse files
committed
Improve tests
1 parent c94c5e9 commit 5c760f0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/ui/entry.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ fn insert_other_if_absent<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, o: K, v:
6969
}
7070

7171
// should not trigger, because the one uses different HashMap from another one
72-
fn insert_other<K: Eq + Hash, V>(m: &mut HashMap<K, V>, n: &mut HashMap<K, V>, k: K, v: V) {
72+
fn insert_from_different_map<K: Eq + Hash, V>(m: HashMap<K, V>, n: &mut HashMap<K, V>, k: K, v: V) {
73+
if !m.contains_key(&k) {
74+
n.insert(k, v);
75+
}
76+
}
77+
78+
// should not trigger, because the one uses different HashMap from another one
79+
fn insert_from_different_map2<K: Eq + Hash, V>(m: &mut HashMap<K, V>, n: &mut HashMap<K, V>, k: K, v: V) {
7380
if !m.contains_key(&k) {
7481
n.insert(k, v);
7582
}

0 commit comments

Comments
 (0)